**You are now following this question**

- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.

# Solving an equation consisting of a PDE and ODE

3 views (last 30 days)

Show older comments

Hello,

I am trying to solve a model equation for a cake filtration system ising methods of line. The equation contains both a PDE and an ODE. I am a beginner in the use of MATLAB. I have attached the description of the equation and a code that have tried putting together. The code seems to have several errors. Could anyone advise on how I could resolve the errors in the code or how better I could structure it

clc;clear;close all;

%Given parameters

espo=0.269; gamma=0.49; beta=0.09; Pa=1200; k0=3.4965*10^(-15); u=0.00089; s=0.2;

qlm=2*10^(-5);

A=(k0*Pa)/(u*beta);

B=(1-gamma)/beta;

t=1:1:1000; %time mesh

N=100; %number of grid points

z=linspace(0,1,N); %space mesh

dz=(1-0)/N;

%initial conditions

for i=1:N

esp0= espo;% for PDE esp(z,t=1 sec)

L0=(s/(esp0-s)*qlm*1);%for ODE L(t=1 sec)

IC=[esp0 L0];

end

%solve the function with ode15s

[t y]=ode15s(@fpde,t,IC,[],espo,A,B,s,z,dz,N,qlm);

%recalculation

%define values

esp=y(1:N,:);

L=y(N+1:2*N,:);

%boundary conditions

despdt(:,1)=2*(qlm/L)*((esp(1)-eps(0))./dz);

esp(:,N)=espo;

%function for PDE-ODE

function dydt=fpde(t,y,espo,A,B,s,z,dz,N,qlm)

dydt=zeros(length(y),1);

despdt=zeros(N,1);

dLdt=zeros(N,1);

%define values

esp=y(1:N);

L=y(N:2*N);

%boundary conditions

despdt(1)=2*(qlm/L)*((esp(1)-eps(0))./dz);

esp(N)=espo;

%main program

%interior

for i=2:N-1

L(i)=(s/((sum(esp(i),'all')+esp(N))./(N-1))-s)*qlm.*t; %calculation of cake length

dLdt(i)=L(i)./t; %growth of cake with time

despdt(i)=((A/L)*((esp(i)/espo)^B)*(esp(i+1)-2*esp(i)+esp(i-1))./dz^2)-((1/L(i))*((z*dLdt(i))+qlm)*(esp(i)-esp(i-1))./dz);

end

dydt=real([despdt;dLdt]);

end

?

##### 16 Comments

Torsten
on 5 Sep 2023

Suzanne
on 5 Sep 2023

Torsten
on 5 Sep 2023

Suzanne
on 5 Sep 2023

Yes, I did. To fix the moving boundary. Let me include it, and resend the document.

Torsten
on 5 Sep 2023

Suzanne
on 5 Sep 2023

Torsten
on 5 Sep 2023

Edited: Torsten
on 5 Sep 2023

The equation

L - s*q_lm*t/(1/L*integral_{x=0}^{x=L} eps_s dx - s) = 0

is an implicit equation for L. It has to be differentiated implicitly with respect to t to derive dL/dt. Did you do that somewhere ? You'll have to apply Leibniz integral rule for the integral:

Another way is to define this equation as an algebraic equation and let ode15i, e.g., compute the time-derivative for you. But usually, ode15i is not that easy to handle and often fails.

Suzanne
on 5 Sep 2023

Are you referring to using it in the code?

In the code, I calculated the epsilon in the expression of L by averaging all the epsilon at different grid points. This is because the PDE was with respect to eta, instead of x

Torsten
on 5 Sep 2023

The thing is that your equation dL/dt = L/t is incorrect if you define L by

L = s*q_lm*t/(1/L*integral_{x=0}^{x=L} eps_s dx - s)

You neglect the time derivative of the expression 1/L*integral_{x=0}^{x=L} eps_s dx.

Suzanne
on 6 Sep 2023

Actually, the equation is supposed to be for dLdt without t as shown below. I wrote it wrongly. It wasn't for L.

dLdt= s*q_lm/(1/L*integral_{x=0}^{x=L} eps_s dx - s)

Suzanne
on 6 Sep 2023

### Accepted Answer

Torsten
on 6 Sep 2023

Edited: Torsten
on 6 Sep 2023

The discretization can be taken from the attached document (formulae 3.1 (c) and 3.2 (c)).

%Given parameters

espo=0.269; gamma=0.49; beta=0.09; Pa=1200; k0=3.4965*10^(-15); u=0.00089; s=0.2;

qlm=2*10^(-5);

A=(k0*Pa)/(u*beta);

B=(1-gamma)/beta;

t=0:100:15000; %time mesh

N=5000; %number of grid points

z=linspace(0,1,N).'; %space mesh

dz=(1-0)/N;

%initial conditions

IC = [ones(N,1)*espo;s/(espo-s)*qlm];

[t,y] = ode15s(@(t,y)fpde(t,y,espo,A,B,s,z,dz,N,qlm),t,IC);

%define values

esp=y(:,1:N);

L=y(:,N+1);

figure(1)

plot(t,L)

figure(2)

hold on

for i = [ 1 3 5 10 20 30 40 50 60 70 80 90 150]

plot(linspace(0,L(i),N),esp(i,:))

end

hold off

xlim([0 0.001])

function dydt=fpde(t,y,espo,A,B,s,z,dz,N,qlm)

dydt=zeros(length(y),1);

despdt=zeros(N,1);

%define values

esp=y(1:N);

L=y(N+1);

dLdt = s/(trapz(z,esp)-s)*qlm;

despdt(1) = A/L^2*(1/((z(2)+z(1))/2-z(1))*(((esp(1)/espo)^B+(esp(2)/espo)^B)/2*...

(esp(2)-esp(1))/(z(2)-z(1))-esp(1)*L/A*qlm))+...

1/L*(z(1)*dLdt+qlm)*(esp(2)-esp(1))/(z(2)-z(1));

despdt(2:N-1) = A/L^2*(1./((z(3:N)+z(2:N-1))/2-(z(2:N-1)+z(1:N-2))/2).*...

((esp(3:N)/espo).^B+(esp(2:N-1)/espo).^B)/2.*(esp(3:N)-esp(2:N-1))./(z(3:N)-z(2:N-1))-...

((esp(2:N-1)/espo).^B+(esp(1:N-2)/espo).^B)/2.*(esp(2:N-1)-esp(1:N-2))./(z(2:N-1)-z(1:N-2)))+...

1/L*(z(2:N-1)*dLdt+qlm).*(esp(3:N)-esp(2:N-1))./(z(3:N)-z(2:N-1));

despdt(N) = 0;

dydt=[despdt;dLdt];

end

##### 21 Comments

Suzanne
on 6 Sep 2023

Edited: Suzanne
on 6 Sep 2023

despdt(1) = A/L^2*(1/((z(2)+z(1))/2-z(1))*(-((esp(1)/espo)^B+(esp(2)/espo)^B)/2*...

(esp(2)-esp(1))/(z(2)-z(1))-esp(1)*L/A*qlm))+...

1/L*(z(1)*dLdt+qlm)*(esp(2)-esp(1))/(z(2)-z(1));

If I am not wrong, after the second *.for the expression despdt as shown above. Is that correct?

Torsten
on 6 Sep 2023

Edited: Torsten
on 6 Sep 2023

The flux at eta = 0 is -esp(1)*L/A*qlm instead of esp(1)*L/A*qlm, thus

despdt(1) = A/L^2*(1/((z(2)+z(1))/2-z(1))*(((esp(1)/espo)^B+(esp(2)/espo)^B)/2*...

(esp(2)-esp(1))/(z(2)-z(1))-(-esp(1)*L/A*qlm)))+...

1/L*(z(1)*dLdt+qlm)*(esp(2)-esp(1))/(z(2)-z(1));

instead of

despdt(1) = A/L^2*(1/((z(2)+z(1))/2-z(1))*(((esp(1)/espo)^B+(esp(2)/espo)^B)/2*...

(esp(2)-esp(1))/(z(2)-z(1))-esp(1)*L/A*qlm))+...

1/L*(z(1)*dLdt+qlm)*(esp(2)-esp(1))/(z(2)-z(1));

The slope changes to negative, but the result does not look satisfactory. I'm quite sure the code implements your equations correctly. Maybe you made some mistake in the choice of parameters or in the equations.

Suzanne
on 6 Sep 2023

Suzanne
on 7 Sep 2023

Torsten, I got the issue. It was the plotting. The x axis is supposed to have the z values.

Then to refine the plot into a curve-like, I have to recheck my dLdt equation and get the appropriate equation.

Torsten
on 7 Sep 2023

Torsten, I got the issue. It was the plotting. The x axis is supposed to have the z values.

Well, I plotted in the original coordinate system (from 0 to L(i)) and restricted the plot to 0 <= z <= 1e-3 because nothing happened for greater values of z. Do you think plotting in [0;1] for L is more appropriate ?

Suzanne
on 7 Sep 2023

Yes. But the section of the code below seems to be of eps over L for specified time, if I got it correctly

for i = [ 1 3 5 10 20 30 40 50 60 70 80 90 150]

plot(linspace(0,L(i),N),esp(i,:))

end

Torsten
on 7 Sep 2023

Edited: Torsten
on 7 Sep 2023

Yes, in the attempt to reproduce the plot you included.

But yes: you can of course also plot eta(z) over time, but note that x in the original coordinate system changes with L, so if you want to keep x constant, you have to change the index i to address esp(i).

Torsten
on 7 Sep 2023

Suzanne
on 7 Sep 2023

Suzanne
on 7 Sep 2023

Yes. So instead of having this:

for i = [ 1 3 5 10 20 30 40 50 60 70 80 90 150]

plot(linspace(0,L(i),N),esp(i,:))

end

We have:

for i = [ 1 3 5 10 20 30 40 50 60 70 80 90 150]

plot(z,esp(i,:))

end

Torsten
on 7 Sep 2023

If you want to plot in the eta-coordinate system: yes.

But to be honest: I wouldn't be able to interpret the plots because they are strongly related with L. So you cannot compare the values for esp at constant eta, while you can do it at constant x.

### More Answers (1)

Mrutyunjaya Hiremath
on 5 Sep 2023

clc; clear; close all;

% Given parameters

espo = 0.269;

gamma = 0.49;

beta = 0.09;

Pa = 1200;

k0 = 3.4965e-15;

u = 0.00089;

s = 0.2;

qlm = 2e-5;

A = (k0 * Pa) / (u * beta);

B = (1 - gamma) / beta;

% Time and space mesh

t = 1:1:1000; % Time mesh

N = 100; % Number of grid points

z = linspace(0, 1, N); % Space mesh

dz = z(2) - z(1); % Grid spacing

% Debug: Display N and length of z

fprintf('N = %d, length of z = %d\n', N, length(z));

N = 100, length of z = 100

% Initial conditions

esp0 = espo * ones(N, 1); % Initial condition for PDE

L0 = (s / (espo - s) * qlm) * ones(N, 1); % Initial condition for ODE (corrected)

IC = [esp0; L0]; % This should now be 200 x 1 if N=100

% Debug: Display length of IC

fprintf('Length of IC = %d\n', length(IC));

Length of IC = 200

% Solve the function with ode15s

options = odeset('RelTol',1e-6,'AbsTol',1e-8);

[t, y] = ode15s(@(t, y) fpde(t, y, espo, A, B, s, z, dz, N, qlm), t, IC, options);

Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current index i = 72
Current index i = 73
Current index i = 74
Current index i = 75
Current index i = 76
Current index i = 77
Current index i = 78
Current index i = 79
Current index i = 80
Current index i = 81
Current index i = 82
Current index i = 83
Current index i = 84
Current index i = 85
Current index i = 86
Current index i = 87
Current index i = 88
Current index i = 89
Current index i = 90
Current index i = 91
Current index i = 92
Current index i = 93
Current index i = 94
Current index i = 95
Current index i = 96
Current index i = 97
Current index i = 98
Current index i = 99
Length of esp = 100, Length of L = 100
Current index i = 2
Current index i = 3
Current index i = 4
Current index i = 5
Current index i = 6
Current index i = 7
Current index i = 8
Current index i = 9
Current index i = 10
Current index i = 11
Current index i = 12
Current index i = 13
Current index i = 14
Current index i = 15
Current index i = 16
Current index i = 17
Current index i = 18
Current index i = 19
Current index i = 20
Current index i = 21
Current index i = 22
Current index i = 23
Current index i = 24
Current index i = 25
Current index i = 26
Current index i = 27
Current index i = 28
Current index i = 29
Current index i = 30
Current index i = 31
Current index i = 32
Current index i = 33
Current index i = 34
Current index i = 35
Current index i = 36
Current index i = 37
Current index i = 38
Current index i = 39
Current index i = 40
Current index i = 41
Current index i = 42
Current index i = 43
Current index i = 44
Current index i = 45
Current index i = 46
Current index i = 47
Current index i = 48
Current index i = 49
Current index i = 50
Current index i = 51
Current index i = 52
Current index i = 53
Current index i = 54
Current index i = 55
Current index i = 56
Current index i = 57
Current index i = 58
Current index i = 59
Current index i = 60
Current index i = 61
Current index i = 62
Current index i = 63
Current index i = 64
Current index i = 65
Current index i = 66
Current index i = 67
Current index i = 68
Current index i = 69
Current index i = 70
Current index i = 71
Current...

% Function for coupled PDE-ODE system

function dydt = fpde(t, y, espo, A, B, s, z, dz, N, qlm)

dydt = zeros(2 * N, 1);

despdt = zeros(N, 1);

dLdt = zeros(N, 1);

% Extract variables

esp = y(1:N);

L = y(N+1:2*N);

% Debug: Display lengths

fprintf('Length of esp = %d, Length of L = %d\n', length(esp), length(L));

% Boundary conditions

despdt(1) = 2 * (qlm / L(1)) * ((esp(1) - espo) / dz);

esp(end) = espo;

% Interior points

for i = 2:N-1

fprintf('Current index i = %d\n', i); % Debug: Display current index

L(i) = (s / ((sum(esp(i)) + esp(N-1)) / (N-1)) - s) * qlm * t; % Debug: Check if t should be scalar

dLdt(i) = L(i) / t; % Debug: Check if t should be scalar

despdt(i) = ((A / L(i)) * ((esp(i) / espo)^B) * (esp(i+1) - 2 * esp(i) + esp(i-1)) / dz^2) - ((1 / L(i)) * ((z(i) * dLdt(i)) + qlm) * (esp(i) - esp(i-1)) / dz);

end

dydt = [despdt; dLdt];

end

##### 1 Comment

Suzanne
on 5 Sep 2023

Hello Hiremath,

Thank you. But 'L' here refers to the cake thickness which grows with time, and hence a function of only t. It is only 'eps' that is a function of both 'z' and 't'. I am trying to get 'eps' at each grid point at different time. And also the change of L with time.

### See Also

### Categories

### Tags

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!**An Error Occurred**

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

- América Latina (Español)
- Canada (English)
- United States (English)

Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)

Asia Pacific

- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)