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 件のコメント
Sean de Wolski
2011 年 5 月 11 日
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
2011 年 5 月 11 日
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
2011 年 5 月 11 日
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
2011 年 5 月 11 日
Much better. Thanks!
Walter Roberson
2011 年 5 月 11 日
No problem.
回答 (1 件)
Jan
2011 年 5 月 11 日
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 件のコメント
Sean de Wolski
2011 年 5 月 11 日
How do you turn off "dbstop if error" ?
Andrew Newell
2011 年 5 月 11 日
dbclear if error
Andrew Newell
2011 年 5 月 11 日
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
2011 年 5 月 11 日
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.
カテゴリ
ヘルプ センター および File Exchange で PDE Solvers についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!