Message Boards Message Boards

0
|
3656 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Nonlinear first order partial differential equations-NDSolve::conarg

I have a big problem solving a set of coupled nonlinear partial differential equations using NDSolve.

Solving the equations by themselves works quite well but if I want to couple them I get

"NDSolve::conarg: The arguments should be ordered consistently. >>"

but I can not see my mistake.

Maybe you can help me with this.

The first equation is:

ParametricNDSolve[
    {D[Int[z, t],z] == -(a*b*Int[z, t]^k), 
    Int[0, t] ==c*(Exp[-4 Log[2] (t/f)^2}
    , Int, {z, 0, 100*10^-9}, {t,tmin1, tmax1}, {a}]

This is easy to solve using Parametric NDsolve.

The second equation is (not coupled): with:

Int2[t]= a*(Exp[-4 Log[2] (t/f)^2]);

ParametricNDSolve[
{D[nn[t], t] == b*Int2[t]^k, 
nn[t <= tmin1] == 0}, 
nn, {t,tmin1,tmax1},{a}, Method -> {StiffnessSwitching, Method -> {ExplicitRungeKutta, Automatic}}]

This is solved using ParametricNDSolve with Method -> {StiffnessSwitching, Method -> {ExplicitRungeKutta, Automatic}}

The coupling is givien by the replacement of Int2[t] by Int[z,t] thus my code should be:

ParametricNDSolve[
  {
   D[Int[z, t], z] == -a*b*Int[z, t]^k
   , Int[0, t] == c*(Exp[-4 Log[2] (t/f)^2])
   , D[nn[z, t], t] ==b*Int[z, t]^k 
   , nn[z, t /; t <= tmin1] == 0
   }
  , {Int, nn}
  , {z, 0, 100*10^-9}
  , {t, tmin1, tmax1}
  , {a}
  , MaxSteps -> 100000
  , MaxStepSize -> Automatic
  , StartingStepSize -> Automatic
  , Method -> {StiffnessSwitching, 
    Method -> {ExplicitRungeKutta, Automatic}}
  , AccuracyGoal -> 2
  , PrecisionGoal -> 2
  , EvaluationMonitor -> Automatic
  ];

a,b,c,f,k, tmin1 and tmax1 are just constants.

I would be glad if you could help me with this (maybe not so big) problem.

Thank you so much in advance.

Best greetings

P.S. This is only the first step and normally there is also a part in the equation for Int[z,t] that depdents on nn[t,z] but it is not in here for reasons of simplicity.

POSTED BY: Thomas Winkler

a,b,c,f,k, tmin1 and tmax1 are just constants.

a is not a constant, it is a parameter.

The error message means (see ref/message/NDSolve/conarg in the help) that each function mentioned must always have the same variable ordering: always f[x,t] exclusive or f[t,x] but not both. That's correct in the example, so the error message can reference only to the intial condition for nn as you might have found already a long time ago, the following runs through

    In[8]:= With[{b = 2, c = 3, f = 4, k = 2, tmin1 = 0, tmax1 = 5},
     ParametricNDSolve[{
       D[Int[z, t], z] == -a*b*Int[z, t]^k,
       D[nn[z, t], t] == b*Int[z, t]^k,
       Int[0, t] == c*(Exp[-4 Log[2] (t/f)^2]),
       nn[z, tmin1(* t /; t\[LessEqual]tmin1 *)] == 0}, 
       {Int, nn}, {z, 0, 100*10^-9}, {t, tmin1, tmax1},
      {a}, 
      MaxSteps -> 100000, MaxStepSize -> Automatic,
      StartingStepSize -> Automatic, 
      Method -> {"StiffnessSwitching", 
        Method -> {"ExplicitRungeKutta", Automatic}}, AccuracyGoal -> 2, 
      PrecisionGoal -> 2,
      EvaluationMonitor -> Automatic]
     ]


Out[8]= {Int -> ParametricFunction[ <> ], nn -> ParametricFunction[ <> ]}

Interestingly one could set k to 2 as well as to 119 and always a result appears instantenously ... possibly the results are fake, are they?

POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract