how to make matlab calculate (x) in PDE
Show older comments
i have one PDE with three variable x,t,u.
so i defind the initial and final value of u, and give range of t, but no matter how much my t range is, it's still met the final u value
how to make matlab calculate x variable with the given range to t in the boundry condition of u
as example if my t is from 10-20, i want matlab to plot the x result at this time
this my command:
function [c,f,s]=eqn11(x,t,u,DuDx,T)
c=1;
f=(1.34*10^-6)*exp(-16000/(8.314.*T))*DuDx;
s=0;
end
------------------------------------------------------------------------------
function [pl,ql,pr,qr]=bc11(xl,ul,xr,ur,t,kp,kd)
pl=xl;
ql=-(kp*5.3347*(5*exp(-kd*t))/0.002);
pr=xr;
qr=-111.8507355;
end
------------------------------------------------------------------------------
function value=initial11(u)
value=5.3347;
-----------------------------------------------------------------------------
kp0=140270;
Eap=43900;
kd0=0.355;
Ead=17400;
T=[333 334 335 336 337 338 339 340];
m=2;
t=linspace(0,120,100)
u=linspace(5.3347*5/0.002,111.8507355,100)
hold on
for i = 1:numel(T)
kp=kp0*exp(-Eap/(8.314*T(i)));
kd=kd0*exp(-Ead/(8.314*T(i)));
x=pdepe(m,@(x,t,u,DuDx)eqn11(x,t,u,DuDx,T(i)),@initial11,@(xl,ul,xr,ur,t)bc11(xl,ul,xr,ur,t,kp,kd),u,t);
end
hold off
plot(x(2,:),u);
xlabel('radius');
ylabel('concentration');
i_hope_my_problem_is_clear
Accepted Answer
More Answers (0)
Categories
Find more on PDE Solvers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!