Discussion:
nonlinear pde solution with pdepe
(too old to reply)
Burcu
2010-08-11 06:08:05 UTC
Permalink
Raw Message
Hi everyone,

I have been trying to solve some equation but every time I fail :(. first issue is, I am neither familiar with many of the stuff nor a mathematician. so, i am having really hard time to find out how i am going to solve the equation.

dk/dt = (1/3)* (d^2 k/dx^2) + (2/3*k)*(dk/dx)^2 +(beta/3*gamma*t) - (2*k/3*t)


all I am asking is how to solve this, not the solution. I would love to find a method that I can imply and solve the equation. any help/comment/suggestion/advice will be greatly appreciated.

p.s: i am trying 'pdepe' but get error, could not find the reason for it, keep trying.

Thank you,
Burcu
Torsten Hennig
2010-08-11 06:48:09 UTC
Permalink
Raw Message
Post by Burcu
Hi everyone,
I have been trying to solve some equation but every
time I fail :(. first issue is, I am neither
familiar with many of the stuff nor a mathematician.
so, i am having really hard time to find out how i
i am going to solve the equation.
dk/dt = (1/3)* (d^2 k/dx^2) + (2/3*k)*(dk/dx)^2
+(beta/3*gamma*t) - (2*k/3*t)
all I am asking is how to solve this, not the
solution. I would love to find a method that I can
imply and solve the equation. any
help/comment/suggestion/advice will be greatly
appreciated.
p.s: i am trying 'pdepe' but get error, could not
find the reason for it, keep trying.
Thank you,
Burcu
Just let us see what you have done so far using pdepe.

Best wishes
Torsten.
Burcu
2010-08-11 12:38:05 UTC
Permalink
Raw Message
thank you for this quick reply.

I just discovered about pdepe, and I did not really do something great. I got the examples(sample codes) and change it with my equation.

cozum.m file:
%% cozum of the formula
function [c,f,s] = cozum(x,t,u,DuDx)
c = 1 ;
f = 1*DuDx/3;
s = (2/3*u)*((DuDx)^(2))-(2*u/3*t);%+ (b/3*g*t)

cozumBC.m file:
%% boundary conditions
function [pleft,qleft,pright,qright] = cozumBC(xl,ul,xr,ur,t)
pleft = 1 ;
qleft = 0 ;
pright = 0;
qright = 0;

cozumIC.m file:
%% initial conditions
function u0 = cozumIC(x)
u0 = 1; %ca/ca0;
end

when i use this code it gives "input argument DuDx undefined" error. i am not sure what the problem is.
Thank you for your time.
Torsten Hennig
2010-08-11 12:58:19 UTC
Permalink
Raw Message
Post by Burcu
thank you for this quick reply.
I just discovered about pdepe, and I did not really
do something great. I got the examples(sample codes)
and change it with my equation.
%% cozum of the formula
function [c,f,s] = cozum(x,t,u,DuDx)
c = 1 ;
f = 1*DuDx/3;
s = (2/3*u)*((DuDx)^(2))-(2*u/3*t);%+ (b/3*g*t)
%% boundary conditions
function [pleft,qleft,pright,qright] =
cozumBC(xl,ul,xr,ur,t)
pleft = 1 ;
qleft = 0 ;
pright = 0;
qright = 0;
%% initial conditions
function u0 = cozumIC(x)
u0 = 1; %ca/ca0;
end
when i use this code it gives "input argument DuDx
undefined" error. i am not sure what the problem is.
Thank you for your time.
I don't know where this error comes from, but one
setting is definitely wrong:
pright = 0;
qright = 0;
in cozumBC will result in an error when executing
the code.
If you want to set du/dx = 0 at x = xright, change
this to
pright = 0;
qright = 1;

Best wishes
Torsten.
Burcu
2010-08-11 13:27:23 UTC
Permalink
Raw Message
:) i was just doing that, thank you so much.
I wish i can run this code, otherwise no way i can solve this equation. i have been trying several books and articles about "how to solve nonlinear pdes" last few weeks, but none of them was helpful ( either i did not understand or the form of equations were different).

could you please let me know if you have some other ideas about error?


Thank you,
Burcu
Torsten Hennig
2010-08-11 13:34:03 UTC
Permalink
Raw Message
Post by Burcu
:) i was just doing that, thank you so much.
I wish i can run this code, otherwise no way i can
solve this equation. i have been trying several
books and articles about "how to solve nonlinear
pdes" last few weeks, but none of them was helpful (
either i did not understand or the form of equations
were different).
could you please let me know if you have some other
ideas about error?
Did you try running the first example under
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/pdepe.html

Best wishes
Torsten.
Post by Burcu
Thank you,
Burcu
Burcu
2010-08-11 14:21:06 UTC
Permalink
Raw Message
Thank you again.

I just want to tell you that I tried all pdepe examples(pdex1pe, pdex2pe, pdex3pe, pdex4pe), all exapmles are working and giving results. and i also checked documentation if i did something wrong. however every thing seems fine, but still gives error.

if u have any furher suggestion, please let me know.

millions of thanks,
Burcu
Burcu
2010-08-11 15:03:04 UTC
Permalink
Raw Message
hi again,

this is just a kind of update.

i think the error is related with s(x,t,u,dudx) function, since my equation's form includes 2/3*u*(du/dx)^2. is there any know restrictions about s(x,t,u,dudx) ?

thank you,
burcu
Torsten Hennig
2010-08-11 15:15:44 UTC
Permalink
Raw Message
Post by Burcu
hi again,
this is just a kind of update.
i think the error is related with s(x,t,u,dudx)
function, since my equation's form includes
2/3*u*(du/dx)^2. is there any know restrictions
ns about s(x,t,u,dudx) ?
thank you,
burcu
Did you try my version ?

Best wishes
Torsten.
Burcu
2010-08-11 15:37:20 UTC
Permalink
Raw Message
hi,

yeah, i tried ur version and also this line:
%sol = pdepe(m,@cozum,@cozumIC,@cozumBC,x,t);
sol = pdepe(2,@(x, t, u, DuDx) cozum(x, t, u, DuDx, 0),@cozumIC,@cozumBC,x,t);


so far, errror is the same.

and one more update: if i use all code in seperate files, error is only one: "dudx is undefined".

if i use all codes in one .m file errors are different: here are the errors
1) Error using ==> daeic12 at 77
This DAE appears to be of index greater than 1.

2)Error in ==> ode15s at 395
[y,yp,f0,dfdy,nFE,nPD,Jfac] = daeic12(odeFcn,odeArgs,t,ICtype,Mt,y,yp0,f0,...

3)Error in ==> pdepe at 320
[t,y] = ode15s(@pdeodes,t,y0,opts);

4)Error in ==> mypde at 6
sol = pdepe(m,@coz,@cozIC,@cozBC,x,t);

:(((( i have no idea what is going on....
Burcu
2010-08-11 16:39:06 UTC
Permalink
Raw Message
it seems there is a way to fix DEA error, but I did not get it..
http://www.mathworks.com/support/solutions/en/data/1-4DANUH/?solution=1-4DANUH
Burcu
2010-08-11 16:51:05 UTC
Permalink
Raw Message
please ignore previous message, it seems that solution for odes not for pdes...

and one more update, errors in l=this link are the same with mine: " http://www.mathworks.fr/support/solutions/en/data/1-AHE4PX/index.html?product=SL&solution=1-AHE4PX "
Burcu
2010-08-11 16:58:04 UTC
Permalink
Raw Message
u can ignore above message..

the following link shows the exact errors i have in my code, so I got the explanation now...:
http://www.mathworks.fr/support/solutions/en/data/1-AHE4PX/index.html?product=SL&solution=1-AHE4PX
Torsten Hennig
2010-08-12 06:23:32 UTC
Permalink
Raw Message
Post by Burcu
u can ignore above message..
the following link shows the exact errors i have in
http://www.mathworks.fr/support/solutions/en/data/1-AH
E4PX/index.html?product=SL&solution=1-AHE4PX
You have a second-derivative term in your PDE ;
so pdepe can be used to solve your equation.

The reason for the error messages is most probably
a mistake in the user-defined subroutines you supply.

Best wishes
Torsten.
guillaume
2010-11-04 09:48:04 UTC
Permalink
Raw Message
Dear all,
I read this message while looking for something else. Is it true pdepe cannot handle second derivatives ?
Isnt it the case in the example pdex4 ?
I must say Im a bit puzzled by this statement
Have a nice day !
G.
Torsten Hennig
2010-08-11 15:05:47 UTC
Permalink
Raw Message
I'm not familiar with MATLAB syntax, but try this:

cozum.m file:
%% cozum of the formula
function [c,f,s] = cozum(x,t,u,DuDx)
c = [1];
f = [DuDx(1)/3];
s = [2/3*u(1)*DuDx(1)^2-2*u(1)/3*t];%+ (b/3*g*t)

cozumBC.m file:
%% boundary conditions
function [pleft,qleft,pright,qright] = cozumBC(xl,ul,xr,ur,t)
pleft = [1];
qleft = [0];
pright = [0];
qright = [1];

cozumIC.m file:
%% initial conditions
function u0 = cozumIC(x)
u0 = [1]; %ca/ca0;
end
Burcu
2010-08-11 15:26:04 UTC
Permalink
Raw Message
hi,

i also tried this one;

%sol = pdepe(m,@cozum,@cozumIC,@cozumBC,x,t); instead of this line, used below
sol = pdepe(2,@(x, t, u, DuDx) cozum(x, t, u, DuDx, 0),@cozumIC,@cozumBC,x,t);

it seems none of them is working and gives exact same error:"dudx is undefined".

thank you for ur helps a lot.

best,
burcu
m***@gmail.com
2017-12-18 05:15:58 UTC
Permalink
Raw Message
anyone know where i can get pdepe background? something like what is pdepe, type of pdepe and all that. i'm looking the information for my writing assignment.
thank you inadvance for helping me.

Loading...