From: Sunipa Som on
Hi,
I have to solve equ
dg/dt=sqrt((2*e)/m) dg/dr
where initial condition
g0= 0.01*exp(-((r-10)/2).^2);
boundary condition
1) dg/dr=0 at r=0
2) g=0 at r=R (We don't know value of R)
I am trying in this way
-------------------------
function [c, f, s]=pdeg1pde(r,t,g,dgdr)
c=1;
f=0;
e=10;
m=2.61*9.109*10^(-31);
s= ((sqrt(2*e))/sqrt(m))*dgdr;
----------------------------
function g0= pdeg1ic(r)
g0= 0.01*exp(-((r-10)/2).^2);
---------------------------------------------
function [p1, q1, p2, q2]= pdeg1bc(r1, g1, r2, g2, t)
p1= 0;
q1= 1;
p2=r2;
q2=0;
-----------------------------------------
r=linspace(0, 20, 10);
>> t=linspace(0,10,10);
>> m=0;
>> sol=pdepe(m,@pdeg1pde,@pdeg1ic, @pdeg1bc, r, t)
-----------------------------------------------------
but error is coming
??? Error using ==> daeic12 at 77
This DAE appears to be of index greater than 1.

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

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

Can you tell me how can I solve it?
Thank you
Sunipa
From: Torsten Hennig on
> Hi,
> I have to solve equ
> dg/dt=sqrt((2*e)/m) dg/dr
> where initial condition
> g0= 0.01*exp(-((r-10)/2).^2);
> boundary condition
> 1) dg/dr=0 at r=0
> 2) g=0 at r=R (We don't know value of R)
> I am trying in this way
> -------------------------
> function [c, f, s]=pdeg1pde(r,t,g,dgdr)
> c=1;
> f=0;
> e=10;
> m=2.61*9.109*10^(-31);
> s= ((sqrt(2*e))/sqrt(m))*dgdr;
> ----------------------------
> function g0= pdeg1ic(r)
> g0= 0.01*exp(-((r-10)/2).^2);
> ---------------------------------------------
> function [p1, q1, p2, q2]= pdeg1bc(r1, g1, r2, g2, t)
> p1= 0;
> q1= 1;
> p2=r2;
> q2=0;

Since you set f=0 above, you have no senseful boundary
condition at r=0. The setting p1=0 and q1=1 just
reads 0 + 1*0 = 0 in terms of the equation p+q*f=0
for the boundary condition (which is true but gives no
information to pdepe).

At the left boundary where you want to prescribe g=0,
you have to set p2 = g2 and q2 = 0.

For your transport equation, the condition at r=R
is physically sufficient. So you must be beware of
the fact that the condition dg/dr=0 at r=0 is
artificial and only set to meet the requirements of
the pdepe-solver.


> -----------------------------------------
> r=linspace(0, 20, 10);
> >> t=linspace(0,10,10);
> >> m=0;
> >> sol=pdepe(m,@pdeg1pde,@pdeg1ic, @pdeg1bc, r, t)
> -----------------------------------------------------
> but error is coming
> ??? Error using ==> daeic12 at 77
> This DAE appears to be of index greater than 1.
>
> Error in ==> ode15s at 395
> [y,yp,f0,dfdy,nFE,nPD,Jfac] =
> c] = daeic12(odeFcn,odeArgs,t,ICtype,Mt,y,yp0,f0,...
>
> Error in ==> pdepe at 320
> [t,y] = ode15s(@pdeodes,t,y0,opts);
>
> Can you tell me how can I solve it?
> Thank you
> Sunipa

As I told you in a previous response, there is no
suitable software in MATLAB to handle hyperbolic partial
differential equations (neither in 1d nor in 2d).
pdepe needs 2nd order derivatives in the model
equations to give stable solutions (d^2g/dr^2).

I can only repeat my advice:
Use CLAWPACK freely available from
http://www.amath.washington.edu/~claw/

Best wishes
Torsten.
From: Sunipa Som on
Hi,
Thank you for help. I will try. If I need more help, I will contact with you.

With Regards,
Sunipa Som

Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote in message <583819052.118599.1256636602885.JavaMail.root(a)gallium.mathforum.org>...
> > Hi,
> > I have to solve equ
> > dg/dt=sqrt((2*e)/m) dg/dr
> > where initial condition
> > g0= 0.01*exp(-((r-10)/2).^2);
> > boundary condition
> > 1) dg/dr=0 at r=0
> > 2) g=0 at r=R (We don't know value of R)
> > I am trying in this way
> > -------------------------
> > function [c, f, s]=pdeg1pde(r,t,g,dgdr)
> > c=1;
> > f=0;
> > e=10;
> > m=2.61*9.109*10^(-31);
> > s= ((sqrt(2*e))/sqrt(m))*dgdr;
> > ----------------------------
> > function g0= pdeg1ic(r)
> > g0= 0.01*exp(-((r-10)/2).^2);
> > ---------------------------------------------
> > function [p1, q1, p2, q2]= pdeg1bc(r1, g1, r2, g2, t)
> > p1= 0;
> > q1= 1;
> > p2=r2;
> > q2=0;
>
> Since you set f=0 above, you have no senseful boundary
> condition at r=0. The setting p1=0 and q1=1 just
> reads 0 + 1*0 = 0 in terms of the equation p+q*f=0
> for the boundary condition (which is true but gives no
> information to pdepe).
>
> At the left boundary where you want to prescribe g=0,
> you have to set p2 = g2 and q2 = 0.
>
> For your transport equation, the condition at r=R
> is physically sufficient. So you must be beware of
> the fact that the condition dg/dr=0 at r=0 is
> artificial and only set to meet the requirements of
> the pdepe-solver.
>
>
> > -----------------------------------------
> > r=linspace(0, 20, 10);
> > >> t=linspace(0,10,10);
> > >> m=0;
> > >> sol=pdepe(m,@pdeg1pde,@pdeg1ic, @pdeg1bc, r, t)
> > -----------------------------------------------------
> > but error is coming
> > ??? Error using ==> daeic12 at 77
> > This DAE appears to be of index greater than 1.
> >
> > Error in ==> ode15s at 395
> > [y,yp,f0,dfdy,nFE,nPD,Jfac] =
> > c] = daeic12(odeFcn,odeArgs,t,ICtype,Mt,y,yp0,f0,...
> >
> > Error in ==> pdepe at 320
> > [t,y] = ode15s(@pdeodes,t,y0,opts);
> >
> > Can you tell me how can I solve it?
> > Thank you
> > Sunipa
>
> As I told you in a previous response, there is no
> suitable software in MATLAB to handle hyperbolic partial
> differential equations (neither in 1d nor in 2d).
> pdepe needs 2nd order derivatives in the model
> equations to give stable solutions (d^2g/dr^2).
>
> I can only repeat my advice:
> Use CLAWPACK freely available from
> http://www.amath.washington.edu/~claw/
>
> Best wishes
> Torsten.
From: Sunipa Som on
Hi,
How can I install clawpack in Windows. I am getting it for unix from documentation. But for windows, what I have to do?

Sunipa


Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote in message <583819052.118599.1256636602885.JavaMail.root(a)gallium.mathforum.org>...
> > Hi,
> > I have to solve equ
> > dg/dt=sqrt((2*e)/m) dg/dr
> > where initial condition
> > g0= 0.01*exp(-((r-10)/2).^2);
> > boundary condition
> > 1) dg/dr=0 at r=0
> > 2) g=0 at r=R (We don't know value of R)
> > I am trying in this way
> > -------------------------
> > function [c, f, s]=pdeg1pde(r,t,g,dgdr)
> > c=1;
> > f=0;
> > e=10;
> > m=2.61*9.109*10^(-31);
> > s= ((sqrt(2*e))/sqrt(m))*dgdr;
> > ----------------------------
> > function g0= pdeg1ic(r)
> > g0= 0.01*exp(-((r-10)/2).^2);
> > ---------------------------------------------
> > function [p1, q1, p2, q2]= pdeg1bc(r1, g1, r2, g2, t)
> > p1= 0;
> > q1= 1;
> > p2=r2;
> > q2=0;
>
> Since you set f=0 above, you have no senseful boundary
> condition at r=0. The setting p1=0 and q1=1 just
> reads 0 + 1*0 = 0 in terms of the equation p+q*f=0
> for the boundary condition (which is true but gives no
> information to pdepe).
>
> At the left boundary where you want to prescribe g=0,
> you have to set p2 = g2 and q2 = 0.
>
> For your transport equation, the condition at r=R
> is physically sufficient. So you must be beware of
> the fact that the condition dg/dr=0 at r=0 is
> artificial and only set to meet the requirements of
> the pdepe-solver.
>
>
> > -----------------------------------------
> > r=linspace(0, 20, 10);
> > >> t=linspace(0,10,10);
> > >> m=0;
> > >> sol=pdepe(m,@pdeg1pde,@pdeg1ic, @pdeg1bc, r, t)
> > -----------------------------------------------------
> > but error is coming
> > ??? Error using ==> daeic12 at 77
> > This DAE appears to be of index greater than 1.
> >
> > Error in ==> ode15s at 395
> > [y,yp,f0,dfdy,nFE,nPD,Jfac] =
> > c] = daeic12(odeFcn,odeArgs,t,ICtype,Mt,y,yp0,f0,...
> >
> > Error in ==> pdepe at 320
> > [t,y] = ode15s(@pdeodes,t,y0,opts);
> >
> > Can you tell me how can I solve it?
> > Thank you
> > Sunipa
>
> As I told you in a previous response, there is no
> suitable software in MATLAB to handle hyperbolic partial
> differential equations (neither in 1d nor in 2d).
> pdepe needs 2nd order derivatives in the model
> equations to give stable solutions (d^2g/dr^2).
>
> I can only repeat my advice:
> Use CLAWPACK freely available from
> http://www.amath.washington.edu/~claw/
>
> Best wishes
> Torsten.
From: Torsten Hennig on
> Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote
> in message
> <583819052.118599.1256636602885.JavaMail.root(a)gallium.
> mathforum.org>...
> > > Hi,
> > > I have to solve equ
> > > dg/dt=sqrt((2*e)/m) dg/dr
> > > where initial condition
> > > g0= 0.01*exp(-((r-10)/2).^2);
> > > boundary condition
> > > 1) dg/dr=0 at r=0
> > > 2) g=0 at r=R (We don't know value of R)
> > > I am trying in this way
> > > -------------------------
> > > function [c, f, s]=pdeg1pde(r,t,g,dgdr)
> > > c=1;
> > > f=0;
> > > e=10;
> > > m=2.61*9.109*10^(-31);
> > > s= ((sqrt(2*e))/sqrt(m))*dgdr;
> > > ----------------------------
> > > function g0= pdeg1ic(r)
> > > g0= 0.01*exp(-((r-10)/2).^2);
> > > ---------------------------------------------
> > > function [p1, q1, p2, q2]= pdeg1bc(r1, g1, r2,
> g2, t)
> > > p1= 0;
> > > q1= 1;
> > > p2=r2;
> > > q2=0;
> >
> > Since you set f=0 above, you have no senseful
> boundary
> > condition at r=0. The setting p1=0 and q1=1 just
> > reads 0 + 1*0 = 0 in terms of the equation p+q*f=0
> > for the boundary condition (which is true but gives
> no
> > information to pdepe).
> >
> > At the left boundary where you want to prescribe
> g=0,
> > you have to set p2 = g2 and q2 = 0.
> >
> > For your transport equation, the condition at r=R
> > is physically sufficient. So you must be beware of
> > the fact that the condition dg/dr=0 at r=0 is
> > artificial and only set to meet the requirements of
>
> > the pdepe-solver.
> >
> >
> > > -----------------------------------------
> > > r=linspace(0, 20, 10);
> > > >> t=linspace(0,10,10);
> > > >> m=0;
> > > >> sol=pdepe(m,@pdeg1pde,@pdeg1ic, @pdeg1bc, r,
> t)
> > >
> -----------------------------------------------------
> > > but error is coming
> > > ??? Error using ==> daeic12 at 77
> > > This DAE appears to be of index greater than 1.
> > >
> > > Error in ==> ode15s at 395
> > > [y,yp,f0,dfdy,nFE,nPD,Jfac] =
> > > c] =
> daeic12(odeFcn,odeArgs,t,ICtype,Mt,y,yp0,f0,...
> > >
> > > Error in ==> pdepe at 320
> > > [t,y] = ode15s(@pdeodes,t,y0,opts);
> > >
> > > Can you tell me how can I solve it?
> > > Thank you
> > > Sunipa
> >
> > As I told you in a previous response, there is no
> > suitable software in MATLAB to handle hyperbolic
> partial
> > differential equations (neither in 1d nor in 2d).
> > pdepe needs 2nd order derivatives in the model
> > equations to give stable solutions (d^2g/dr^2).
> >
> > I can only repeat my advice:
> > Use CLAWPACK freely available from
> > http://www.amath.washington.edu/~claw/
> >
> > Best wishes
> > Torsten.

> Hi,
> How can I install clawpack in Windows. I am
> I am getting it for unix from documentation. But for
> windows, what I have to do?
>
> Sunipa

Hi Sunipa,

you do not need to 'install' it. Just put the fortran
routines belonging together in one directory, compile
with a fortran compiler for WINDOWS and here we go.

Best wishes
Torsten.