From: Kamel on
Thank you Torsten, very clever. I will try your idea.
Just a question about this boundary condition: Y(z=h,t) = Y^(-1)(sig0). I don't understand how to get it. Could you explain me the link of this BC with the initial one: sig(h,t)=sig0 ?

Thank you very much.

By the way, I also will have a look on Clawpack. It seems to be useful for others applications.

Regards,

Kamel


Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote in message <1218233707.21485.1271399614845.JavaMail.root(a)gallium.mathforum.org>...
> > >
> > <1558865423.15632.1271314738298.JavaMail.root(a)gallium.
> >
> > > mathforum.org>...
> > > > > Hello,
> > > > >
> > > > > I would like to resolve a non linear PDE (used
> > in
> > > > > porous media) which looks like:
> > > > >
> > > > > H*d2u/dz2=dU/dt,
> > > > > with H = (k1/Y)*dsig/dY ;
> > > > > Sig = k2*(Y^2-1)/(Y^2+1)*exp((Y^2-1) ;
> > > > > Y=1+du/dz ;
> > > > >
> > > >
> > > > Are u and U identical ?
> > > > Do you know whether H = k1/Y*dsig/dY > 0
> > throughout
> > > ?
> > > >
> > > > > with one initial condition: U(z=0, t)=0
> > > > > and 2 BC : U(0,t)=0 and sig(h,t)=sig0
> > > > >
> > > > > k1, k2, sig0 are constants.
> > > > >
> > > > > Do you know what is the best way to resolve
> > this
> > > kind
> > > > > of problem using finite difference method?
> > > > > I know how to resolve a simple linear
> > parabolic
> > > PDE
> > > > > using a finite difference scheme (2nd order
> > > spatial
> > > > > discretization + backward euler time
> > integration)
> > > but
> > > > > in this case, the problem is more complex. I
> > > guess
> > > > > that an implicit three-point centered finite
> > > > > difference method should work but I don't know
> > > how to
> > > > > discretize the equations and the boundary
> > > conditions.
> > > > >
> > > > >
> > > > > I would be very grateful if you could help me
> > or
> > > > > guide me!
> > > > >
> > > > > Thank you
> > > > >
> > > > > Kmel
> > > >
>
> I thought about your problem again and came to the
> following more direct approach:
>
> You can use MATLAB's pdepe to solve the following
> system:
>
> du/dt = H*d^2u/dz^2
> 0 = du/dz + (1-Y)
>
> with boundary conditions
>
> u(z=0,t) = 0
> du/dz(z=0,t) = Y - 1
>
> du/dz(z=h,t) = Y - 1
> Y(z=h,t) = Y^(-1)(sig0)
>
> Best wishes
> Torsten.
From: Torsten Hennig on
> Thank you Torsten, very clever. I will try your idea.
> Just a question about this boundary condition:
> Y(z=h,t) = Y^(-1)(sig0). I don't understand how to
> get it. Could you explain me the link of this BC with
> the initial one: sig(h,t)=sig0 ?
>

Before calling pdepe,
you will have to solve the nonlinear equation
sig0 - k2*(Y^2-1)/(Y^2+1)*exp((Y^2-1)= 0
for Y to get Y(z=h,t).
(Maybe by table calculator, maybe by using fsolve)

Best wishes
Torsten.


> Thank you very much.
>
> By the way, I also will have a look on Clawpack. It
> seems to be useful for others applications.
>
> Regards,
>
> Kamel
>
>
> Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote
> in message
> <1218233707.21485.1271399614845.JavaMail.root(a)gallium.
> mathforum.org>...
> > > >
> > >
> <1558865423.15632.1271314738298.JavaMail.root(a)gallium.
> > >
> > > > mathforum.org>...
> > > > > > Hello,
> > > > > >
> > > > > > I would like to resolve a non linear PDE
> (used
> > > in
> > > > > > porous media) which looks like:
> > > > > >
> > > > > > H*d2u/dz2=dU/dt,
> > > > > > with H = (k1/Y)*dsig/dY ;
> > > > > > Sig = k2*(Y^2-1)/(Y^2+1)*exp((Y^2-1)
> ;
> > > > > > Y=1+du/dz ;
> > > > > >
> > > > >
> > > > > Are u and U identical ?
> > > > > Do you know whether H = k1/Y*dsig/dY > 0
> > > throughout
> > > > ?
> > > > >
> > > > > > with one initial condition: U(z=0, t)=0
> > > > > > and 2 BC : U(0,t)=0 and sig(h,t)=sig0
> > > > > >
> > > > > > k1, k2, sig0 are constants.
> > > > > >
> > > > > > Do you know what is the best way to resolve
> > > this
> > > > kind
> > > > > > of problem using finite difference method?
> > > > > > I know how to resolve a simple linear
> > > parabolic
> > > > PDE
> > > > > > using a finite difference scheme (2nd order
> > > > spatial
> > > > > > discretization + backward euler time
> > > integration)
> > > > but
> > > > > > in this case, the problem is more complex.
> I
> > > > guess
> > > > > > that an implicit three-point centered
> finite
> > > > > > difference method should work but I don't
> know
> > > > how to
> > > > > > discretize the equations and the boundary
> > > > conditions.
> > > > > >
> > > > > >
> > > > > > I would be very grateful if you could help
> me
> > > or
> > > > > > guide me!
> > > > > >
> > > > > > Thank you
> > > > > >
> > > > > > Kmel
> > > > >
> >
> > I thought about your problem again and came to the
> > following more direct approach:
> >
> > You can use MATLAB's pdepe to solve the following
> > system:
> >
> > du/dt = H*d^2u/dz^2
> > 0 = du/dz + (1-Y)
> >
> > with boundary conditions
> >
> > u(z=0,t) = 0
> > du/dz(z=0,t) = Y - 1
> >
> > du/dz(z=h,t) = Y - 1
> > Y(z=h,t) = Y^(-1)(sig0)
> >
> > Best wishes
> > Torsten.
From: Kamel on
Ok! I got it.
Thank you very much for your time!

Regards,

Kamel



Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote in message <1057664350.22477.1271413238687.JavaMail.root(a)gallium.mathforum.org>...
> > Thank you Torsten, very clever. I will try your idea.
> > Just a question about this boundary condition:
> > Y(z=h,t) = Y^(-1)(sig0). I don't understand how to
> > get it. Could you explain me the link of this BC with
> > the initial one: sig(h,t)=sig0 ?
> >
>
> Before calling pdepe,
> you will have to solve the nonlinear equation
> sig0 - k2*(Y^2-1)/(Y^2+1)*exp((Y^2-1)= 0
> for Y to get Y(z=h,t).
> (Maybe by table calculator, maybe by using fsolve)
>
> Best wishes
> Torsten.
>
>
> > Thank you very much.
> >
> > By the way, I also will have a look on Clawpack. It
> > seems to be useful for others applications.
> >
> > Regards,
> >
> > Kamel
> >
> >
> > Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote
> > in message
> > <1218233707.21485.1271399614845.JavaMail.root(a)gallium.
> > mathforum.org>...
> > > > >
> > > >
> > <1558865423.15632.1271314738298.JavaMail.root(a)gallium.
> > > >
> > > > > mathforum.org>...
> > > > > > > Hello,
> > > > > > >
> > > > > > > I would like to resolve a non linear PDE
> > (used
> > > > in
> > > > > > > porous media) which looks like:
> > > > > > >
> > > > > > > H*d2u/dz2=dU/dt,
> > > > > > > with H = (k1/Y)*dsig/dY ;
> > > > > > > Sig = k2*(Y^2-1)/(Y^2+1)*exp((Y^2-1)
> > ;
> > > > > > > Y=1+du/dz ;
> > > > > > >
> > > > > >
> > > > > > Are u and U identical ?
> > > > > > Do you know whether H = k1/Y*dsig/dY > 0
> > > > throughout
> > > > > ?
> > > > > >
> > > > > > > with one initial condition: U(z=0, t)=0
> > > > > > > and 2 BC : U(0,t)=0 and sig(h,t)=sig0
> > > > > > >
> > > > > > > k1, k2, sig0 are constants.
> > > > > > >
> > > > > > > Do you know what is the best way to resolve
> > > > this
> > > > > kind
> > > > > > > of problem using finite difference method?
> > > > > > > I know how to resolve a simple linear
> > > > parabolic
> > > > > PDE
> > > > > > > using a finite difference scheme (2nd order
> > > > > spatial
> > > > > > > discretization + backward euler time
> > > > integration)
> > > > > but
> > > > > > > in this case, the problem is more complex.
> > I
> > > > > guess
> > > > > > > that an implicit three-point centered
> > finite
> > > > > > > difference method should work but I don't
> > know
> > > > > how to
> > > > > > > discretize the equations and the boundary
> > > > > conditions.
> > > > > > >
> > > > > > >
> > > > > > > I would be very grateful if you could help
> > me
> > > > or
> > > > > > > guide me!
> > > > > > >
> > > > > > > Thank you
> > > > > > >
> > > > > > > Kmel
> > > > > >
> > >
> > > I thought about your problem again and came to the
> > > following more direct approach:
> > >
> > > You can use MATLAB's pdepe to solve the following
> > > system:
> > >
> > > du/dt = H*d^2u/dz^2
> > > 0 = du/dz + (1-Y)
> > >
> > > with boundary conditions
> > >
> > > u(z=0,t) = 0
> > > du/dz(z=0,t) = Y - 1
> > >
> > > du/dz(z=h,t) = Y - 1
> > > Y(z=h,t) = Y^(-1)(sig0)
> > >
> > > Best wishes
> > > Torsten.
From: Kamel on
Dear Torsten,

Resolution of the nonlinear equation is now easy to do.
I have just a small trouble with one of the boundary cdt using pdepe.

I wrote the equations like this for the resolution using pdepe:
(u1=u, u2=Y)

(1/H, 0)*d/dt(u1, u2)=d/dz*(du1/dz, u1)+(0, 1-u2)
and the pdepe coefficients are normally:
c = [1/H; 0];
f = [DuDz; u] ;
s = [0; 1-u2];

What I am suggesting for the boundary conditions is
left:
(u1, u2-1) + (0, -du1/dz*(du2/dz)^-1)*(du1/dz,du2/dz) = (0, 0)
right:
(u2-u1-1, u2-u2^-1(sig0)) + (0, 0)*(du1/dz,du2/dz) = (0, 0)

which should lead to pdex1bc coefficients in the following form:
pl = [ul(1); ul(2)-1];
ql = [0; ??];
pr = [ur(2)-ur(1)-1; ur(2)-ur2^-1(sig0)];
qr = [0; 0];

My question is: how can I write the second ql condition (in ??) corresponding to the term -du1/dz*(du2/dz)^-1 ?

Thank you in advance for your precious help.

Best regards,

Kamel




"Kamel " <kamel.madi(a)port.ac.uk> wrote in message <hq9fkd$fja$1(a)fred.mathworks.com>...
> Ok! I got it.
> Thank you very much for your time!
>
> Regards,
>
> Kamel
>
>
>
> Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote in message <1057664350.22477.1271413238687.JavaMail.root(a)gallium.mathforum.org>...
> > > Thank you Torsten, very clever. I will try your idea.
> > > Just a question about this boundary condition:
> > > Y(z=h,t) = Y^(-1)(sig0). I don't understand how to
> > > get it. Could you explain me the link of this BC with
> > > the initial one: sig(h,t)=sig0 ?
> > >
> >
> > Before calling pdepe,
> > you will have to solve the nonlinear equation
> > sig0 - k2*(Y^2-1)/(Y^2+1)*exp((Y^2-1)= 0
> > for Y to get Y(z=h,t).
> > (Maybe by table calculator, maybe by using fsolve)
> >
> > Best wishes
> > Torsten.
> >
> >
> > > Thank you very much.
> > >
> > > By the way, I also will have a look on Clawpack. It
> > > seems to be useful for others applications.
> > >
> > > Regards,
> > >
> > > Kamel
> > >
> > >
> > > Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote
> > > in message
> > > <1218233707.21485.1271399614845.JavaMail.root(a)gallium.
> > > mathforum.org>...
> > > > > >
> > > > >
> > > <1558865423.15632.1271314738298.JavaMail.root(a)gallium.
> > > > >
> > > > > > mathforum.org>...
> > > > > > > > Hello,
> > > > > > > >
> > > > > > > > I would like to resolve a non linear PDE
> > > (used
> > > > > in
> > > > > > > > porous media) which looks like:
> > > > > > > >
> > > > > > > > H*d2u/dz2=dU/dt,
> > > > > > > > with H = (k1/Y)*dsig/dY ;
> > > > > > > > Sig = k2*(Y^2-1)/(Y^2+1)*exp((Y^2-1)
> > > ;
> > > > > > > > Y=1+du/dz ;
> > > > > > > >
> > > > > > >
> > > > > > > Are u and U identical ?
> > > > > > > Do you know whether H = k1/Y*dsig/dY > 0
> > > > > throughout
> > > > > > ?
> > > > > > >
> > > > > > > > with one initial condition: U(z=0, t)=0
> > > > > > > > and 2 BC : U(0,t)=0 and sig(h,t)=sig0
> > > > > > > >
> > > > > > > > k1, k2, sig0 are constants.
> > > > > > > >
> > > > > > > > Do you know what is the best way to resolve
> > > > > this
> > > > > > kind
> > > > > > > > of problem using finite difference method?
> > > > > > > > I know how to resolve a simple linear
> > > > > parabolic
> > > > > > PDE
> > > > > > > > using a finite difference scheme (2nd order
> > > > > > spatial
> > > > > > > > discretization + backward euler time
> > > > > integration)
> > > > > > but
> > > > > > > > in this case, the problem is more complex.
> > > I
> > > > > > guess
> > > > > > > > that an implicit three-point centered
> > > finite
> > > > > > > > difference method should work but I don't
> > > know
> > > > > > how to
> > > > > > > > discretize the equations and the boundary
> > > > > > conditions.
> > > > > > > >
> > > > > > > >
> > > > > > > > I would be very grateful if you could help
> > > me
> > > > > or
> > > > > > > > guide me!
> > > > > > > >
> > > > > > > > Thank you
> > > > > > > >
> > > > > > > > Kmel
> > > > > > >
> > > >
> > > > I thought about your problem again and came to the
> > > > following more direct approach:
> > > >
> > > > You can use MATLAB's pdepe to solve the following
> > > > system:
> > > >
> > > > du/dt = H*d^2u/dz^2
> > > > 0 = du/dz + (1-Y)
> > > >
> > > > with boundary conditions
> > > >
> > > > u(z=0,t) = 0
> > > > du/dz(z=0,t) = Y - 1
> > > >
> > > > du/dz(z=h,t) = Y - 1
> > > > Y(z=h,t) = Y^(-1)(sig0)
> > > >
> > > > Best wishes
> > > > Torsten.
From: Torsten Hennig on
> Dear Torsten,
>
> Resolution of the nonlinear equation is now easy to
> do.
> I have just a small trouble with one of the boundary
> cdt using pdepe.
>
> I wrote the equations like this for the resolution
> using pdepe:
> (u1=u, u2=Y)
>
> (1/H, 0)*d/dt(u1, u2)=d/dz*(du1/dz, u1)+(0, 1-u2)
> and the pdepe coefficients are normally:
> c = [1/H; 0];
> f = [DuDz; u] ;
> s = [0; 1-u2];
>
> What I am suggesting for the boundary conditions is
> left:
> (u1, u2-1) + (0, -du1/dz*(du2/dz)^-1)*(du1/dz,du2/dz)
> = (0, 0)
> right:
> (u2-u1-1, u2-u2^-1(sig0)) + (0, 0)*(du1/dz,du2/dz) =
> (0, 0)
>
> which should lead to pdex1bc coefficients in the
> following form:
> pl = [ul(1); ul(2)-1];
> ql = [0; ??];
> pr = [ur(2)-ur(1)-1; ur(2)-ur2^-1(sig0)];
> qr = [0; 0];
>
> My question is: how can I write the second ql
> condition (in ??) corresponding to the term
> -du1/dz*(du2/dz)^-1 ?
>
> Thank you in advance for your precious help.
>
> Best regards,
>
> Kamel
>
>

I thought to take

c = [1/H; 0];
f = [DuDz(1); 0] ;
s = [0; Dudz(1)+1-u2];

pl = [1-ul(2);ul(1)];
ql = [1 ; 0];
pr = [1-ur(2);ur(2)-u(2)^(-1)(sig0)];
qr = [1 ; 0];

A problem may arise at the right boundary because
at t=0, du/dz=0 at z=h, but Y=Y^(-1)(sig0) <> 1 in
general.
Maybe you can adjust the initial value for u
at z=h such that du/dz|z=h = Y^(-1)(sig0) - 1.

Best wishes
Torsten.