i don't find the error

i have this system:
dC/dt+(u/epsilon)*dC/dz-Dl*(d^2 C)/(dz^2 )+((1-epsilon)/epsilon)*(rhos/rhof)*dq/dt=0 ;
dq/dt=K*a*(q-Keq*C )
the initial and boundary conditions are:
t=0, C=C0, z>0
t=0, q=q0, z>0
z=0, (u/epsilon)* C-Dl*dC/dz=0, t>0
z=L, dC/dz=0, et dq/dz=0 ;t>0
i wrote this algorithm but i have an error that i don't find it:
function vasco
m=0;
z=linspace(0,30);
t=[ 0 50 100 150 200];
sol = pdepe(m,@pdexpde,@pdexic,@pdexbc,z,t);
C = sol(:,:,1);
q = sol(:,:,2);
function [g,f,s]= pdexpde(z,t,C,DCDz)
rhos=0.55;
rhof=0.385;
dp=0.03;
a=6/dp;
epsilon=0.45;
Ki=1.4E-7;
u=0.098;
Dl=4.7E-5;
keq=16.86;
A=Ki*a*(C(2)-(keq*C(1)));
B=((1-epsilon)/epsilon)*(rhos/rhof)*A;
g=[1; 1];
f=[Dl.*DCDz; 0];
s=[((-u)/epsilon).*DCDz-B; A];
function u0 = pdexic(z)
c0=0.0015;
q0=2.53E-2;
u0 = [c0; q0];
% -------------------------------------------------------------------------
function [pl,ql,pr,qr] = pdexbc(zl,Cl,zr,Cr,t)
q0=2.53E-2;
Dl=4.7E-5;
epsilon=0.45;
u=0.098;
pl = [(u/epsilon)*Cl(1); Cl(2)-q0];
ql = [-1; 0];
pr = [0; 0];
qr = [(1/Dl); 0];
this is the first time that i use matlab so this program is true for this type of système??
thanks in advance for your help!!! please it's urgent

5 commentaires

Sean de Wolski
Sean de Wolski le 11 Mai 2011
So what is the problem? Is it erroring out? If it is, what is the FULL TEXT of the error message. Or is it just not giving the results you expect?
Andrew Newell
Andrew Newell le 11 Mai 2011
mouna, you have asked a few questions in this forum. It is time you learned how to format the code in your question so we can easily cut and paste it. See, for example, this question: http://www.mathworks.com/matlabcentral/answers/7164-using-conditional-and-in-if-statements
Jan
Jan le 11 Mai 2011
Although Sean and Andrew have said it already: If your problem is urgent, take the time to format it correctly (it is just one mouse-click for you!) and post the complete error message.
Andrew Newell
Andrew Newell le 11 Mai 2011
Much better. Thanks!
Walter Roberson
Walter Roberson le 11 Mai 2011
No problem.

Connectez-vous pour commenter.

Réponses (1)

Jan
Jan le 11 Mai 2011

2 votes

Faster than asking here is using the debugger:
dbstop if error
Then Mtlab stops, when the error occurs and you can inspect the current values of the variables to find out, what causes the problem.

4 commentaires

Sean de Wolski
Sean de Wolski le 11 Mai 2011
How do you turn off "dbstop if error" ?
Andrew Newell
Andrew Newell le 11 Mai 2011
dbclear if error
Andrew Newell
Andrew Newell le 11 Mai 2011
Also, unless you have a really old version of MATLAB, you should be able to click on a link in the error message to take you to the line where the error was flagged.
Sean de Wolski
Sean de Wolski le 11 Mai 2011
Excellent thank you! I'd always wondered that; since I rarely close MATLAB I find a residual dbstop if error messing with me a day or two after needing it.

Connectez-vous pour commenter.

Question posée :

le 11 Mai 2011

Community Treasure Hunt

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

Start Hunting!

Translated by