1
$\begingroup$

I have the following differential equation:

a*L'[t] == 40000*L[t]^(-3/2) - 1.4 - extf

I want to fit the solution to data in order to acquire a. I tried DSolve with a=1 and separation of variables:

Clear[t]
Clear[L]
extf = 15
tmax = 100
solt = Integrate[1/(40000*L0^(-3/2) - 1.4 - extf), {L0, 10, L}, Assumptions -> 10 < L < 181.194];
solL = L -> InverseFunction[Evaluate[solt] & /. L -> #]
N[L[1000] /. solL]

 OUTPUT=  -16618.8 - 341.659i

This is wrong (should be around 170..) so that I tried NDSolve:

Clear[t]
Clear[L]
Clear[a]
extf = 15
tmax = 100
solution = ParametricNDSolve[{a*L'[t] == 40000*L[t]^(-3/2) - 1.4 - extf, 
           L[0] == 10}, L, {t, 0, tmax}, {a}]

Manipulate[ Plot[Evaluate[L[a][t] /. solution], {t, 0, tmax}, 
                  PlotRange -> All], {a, 1, 2}]

That gives me the right graph but I cannot fit this result to my data to obtain the right a nor is it as nice as a analytic expression.

What is going wrong with DSolve?

$\endgroup$
1

1 Answer 1

3
$\begingroup$

DSolve can solve a generalized equation:

sol = DSolve[{a*L'[t] == b*L[t]^(-3/2) - c, L[0] == L0}, L, t]
(*
  {{L -> Function[{t}, InverseFunction[... &][-(t/a) +...]]}}
*)

Block[{b = 40000, c = 1.4 + extf, L0 = 10},
 Plot[Evaluate[L[t] /. sol /. {{a -> 1}, {a -> 2}}], {t, 0, tmax}, PlotRange -> All]
 ]

Mathematica graphics

It agrees with the OP's numeric solution:

Plot[Evaluate[{L[1][t], L[2][t]} /. solution], {t, 0, tmax}, PlotRange -> All]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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