Hi everyone
I am trying to solve a PDE through method of lines, using ODE15s.
I get the error message
Not enough input arguments.Error in TracerFlow (line 3)dCdt=zeros(Nz,1);
The code script are pasted.
Thanks
% RunTracerFlow
close allclear allclc% Data
tspan = linspace(0,60,61);L =1;Nz = 100;CA0init =0.1; dz = L./Nz;Da = 2e-1;U = 2e-1;k = 1;IC = zeros(1,Nz);% Solver
[t c] = ode15s(@TracerFlow,tspan,IC,[],Nz,CA0init,dz,Da,U,k)% Recalculation
C(:,1) = CA0init+1./900.*(60.*t-t.^2);C(:,N+1) = 1./3.*(4.*C(:,Nz) -C(:,Nz-1)); %dCdt = 0
% Plotting
xaxis = linspace(0,L,Nz+1);yaxis = tspan;images(xaxis,yaxis,C)xlabel('axial position')ylabel('timespan')colormap jetcolorbar
function dCdt = TracerFlow(t,C,Nz,CA0init,dz,Da,U,k)% Pre-allocations
dCdt=zeros(Nz,1);% Define boundary conditions
C(1) = CA0init+1./900.*(60.*t-t.^2);C(Nz+1) = 1./3.*(4.*C(Nz) -C(Nz-1)); %dCdt = 0for i = 2:Nz dCdz(i)= 1./(2.*dz).*(C(i+1)-C(i-1)); %centred
d2Cdz2(i) = 1./(dz.^2).*(C(i+1)-2.*C(i)+C(i-1)); dCdt(i)=Da.*d2Cdz2(i)-U.*dCdz(i)-k.*C(i).^2;endend
Best Answer