2
$\begingroup$

I have a big problem solving a set of coupled nonlinear 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 guys can help me with this.

The first equation is:

D[Int[z, t], z] == -(c Int[z, t]^k), Int[0, t] == a (Exp[-4 Log[2] (t/f)^2])

This is easy to solve using Parametric NDsolve.

The second equation is (not coupled):

D[nn[t], t] == b Int2[t]^k, nn[t <= tmin1] == 0 

with

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

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

The coupling is simply givien by the fact that Int2[t] should now be Int[z,t] thus my code should be:

ParametricNDSolve[
  {
   D[Int[z, t], z] == -(c Int[z, t]^k)
   , Int[0, t] == a (Exp[-4 Log[2] (t/f)^2])
   , D[nn[z, t], t] == σ 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
  ];

b,c,f,k are just constants, a is a parameter of interest.

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

Thank you so much in advance.

Best greetings

$\endgroup$
1
$\begingroup$

Instead of

nn[z, t /; t <= tmin1] == 0

you should state the boundary condition as

nn[z, tmin1] == 0
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.