Borrar filtros
Borrar filtros

Solving an equation consisting of a PDE and ODE

4 visualizaciones (últimos 30 días)
Suzanne
Suzanne el 5 de Sept. de 2023
Comentada: Torsten el 7 de Sept. de 2023
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 comentarios
Torsten
Torsten el 6 de Sept. de 2023
It's ok. I was wrong. See my code below.
Suzanne
Suzanne el 6 de Sept. de 2023
Thank you. Let me check it ou.

Iniciar sesión para comentar.

Respuesta aceptada

Torsten
Torsten el 6 de Sept. de 2023
Editada: Torsten el 6 de Sept. de 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 comentarios
Suzanne
Suzanne el 7 de Sept. de 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
Torsten el 7 de Sept. de 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.

Iniciar sesión para comentar.

Más respuestas (1)

Mrutyunjaya Hiremath
Mrutyunjaya Hiremath el 5 de Sept. de 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 comentario
Suzanne
Suzanne el 5 de Sept. de 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.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by