how can I add complex boundary conditions to pdepe functions?
Show older comments
I am trying to solve a following problem: dq(x,t)/dt=D*d/dx(dq(x,t)/dx)
with initial conditions: q(x,0)=0 and boundary conditions: dq(0,t)/dx=0 q(x,t)=f(cs) (for example linear function A*cs) B*D*dq(x,t)/dx=k*(cc-cs)
where cc is a concentration dependent on time and it is changing with time
My code (example constants) is as follows: function [c,f]=func1(x,t,q,Dqdx) c=1; D=5; f=D*Dqdx;
function q0=init(x) q0=0;
function [p1,q1,pr,qr]=bound(x1,u1,xr,ur,t) %I don't know where I need to put this: q(x,t)=f(cs) (for example linear function A*cs) p1=0; q1=1; B=10; cc=linspace(0,1,500); %should i put it here? or in main function? cs=linspace(0,0.1,50); pr=iso(cc,cs); % I am sure that it is not ok qr=B; % this one too
function y=iso(cc,cs) kf=10; y=kf.*(cc-cs);
I appreciate any help
Accepted Answer
More Answers (0)
Categories
Find more on Neuroimaging 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!