Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: solving an awkard PDE
Replies: 2   Last Post: Mar 20, 2013 7:34 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Torsten Hennig

Posts: 2,419
Registered: 12/6/04
Re: solving an awkard PDE
Posted: Mar 20, 2013 4:08 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> Hi Guys
> I've been wanting to implement the coupled system (3
> components) of PDEs (MATLAB code as below) but
> without much luck. It gives me the error 'ERROR USING
> DAEIC12 (LINE 12)'. I had a suspicion all along that
> MATLAB is not even capable of solving such a system,
> seeing that the last component equation is not a PDE,
> but an ODE (only has a time dependency). It's a bit
> difficult to visulaise the equation using text, but i
> can send you guys a pdf if you email me:
> Jimmyshek.js@gmail.com
>
> As such, I wonder if there are any high level
> software similar to Matlab that has the capability to
> solve this system? My programming experience is very
> limited (I'm a beginner) and I'm in not position to
> use the vast amounts of numerical libraries avaliable
> as time is an issue for me as well.
>
> Many Thanks
> Jimmy.
>
> %MATLAB COMMAND LINE ARGUMENTS
> %************************************************
> m = 0;
> x = [0: 0.1: 20];
> t = [0: 0.05: 100];
>
> sol = pdepe(m,@m_eqn,@m_ic,@m_bc,x,t);
> u1 = sol(:,:,1);
> u2 = sol(:,:,2);
> u3 = sol(:,:,3);
>
> %INITIAL CONDITIONS
> %************************************************
> function u0 = m_ic(x);
> u0 = [1.5; 0.001; 180];
>
> %BOUNDARY CONDITIONS
> %************************************************
>
> function [pl,ql,pr,qr] = m_bc(xl,ul,xr,ur,t)
> pl = [0; 0; 0];
> ql = [1; 1; 0];
> pr = [0; 0; 0];
> qr = [1; 1; 0];
> %************************************************
>
> %FUNCTION STORING THE EQUATIONS
> %************************************************
> function [c,f,s]=m_eqn(x,t,u,DuDx)
> c = [1; 1; 1];
>
> %parameters
> D1=0;
> D2=0;
> c1=6.64;
> c2=5;
> c3=3.13*10^(-5);
> c4=1;
> c5=2;
> c6=0.5;
> c7=0.6;
> K1=0.1;
> K2=0.15;
> K3=1;
> R=0.42;
>
> %parts of the eqn
> J1=c1*((u(2)^3)/((K1+u(2))^3))*u(3);
> J2=(c2*(u(1))^2)/((u(1)+K2)^2)-c3*(u(3))^2;
> kp=c4*R*(u(1)/(u(1)+K3));
> km=c5*u(2);
>
> s=[J1-J2-c6*(u(1)/c7)^3.3+c6; kp-km; J2-J1];
> f=[D1; D2; 0] .* DuDx;


If you have a little experience with FORTRAN, try
http://www.netlib.org/toms/690
It is capable to handle parabolic-elliptic PDEs coupled with ODEs.
Otherwise, you will have to discretize the second-order derivatives in your PDEs and solve the resulting system of ODEs for the solution variables in each grid point using ODE15s,e.g..

Best wishes
Torsten.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.