1
$\begingroup$

I was working on this equation but I can't get out something for this:

Clear["Global`*"]
g[t_] := ((1 - b) y[t]^2/t^n + 1/t^(2 + n))^n;
eqns = y'[t] + 3/2 (a - b) y[t]/t + (3/2 a - 1)/y[t] t^3 == g[t];
DSolve[eqns, y, t]

a,b are positive but n could be negative or positive. Also plotting this equation will be usefull.

$\endgroup$
9
  • $\begingroup$ Also y[t0]==y0 just in case. $\endgroup$ Jan 18, 2022 at 15:25
  • 1
    $\begingroup$ I doubt there is analytical solution to this. Try NDSolve $\endgroup$
    – Nasser
    Jan 18, 2022 at 15:36
  • $\begingroup$ MMA does not give a solution. Are you sure that a close form solution exists? $\endgroup$ Jan 18, 2022 at 15:47
  • $\begingroup$ Even you can consider a==4/3 and b==7/10 $\endgroup$ Jan 18, 2022 at 15:52
  • 1
    $\begingroup$ why is it important to get analytical solution? You can get numerical solution. If you want to see the effect on the solution due to different values, this also can be done numerically by changing the parameter values using Manipulate and see how the solution changes. You are not going to get a general analytical solution to this. Even the powerful DSolve can't solve unsolvable ode's. $\endgroup$
    – Nasser
    Jan 18, 2022 at 16:01

1 Answer 1

5
$\begingroup$

Do not have time to make a full Manipulate, but you can start with

Clear["Global`*"]
g[t_]:=((1-b) y[t]^2/t^n+1/t^(2+n))^n;
ode=y'[t]+3/2 (a-b) y[t]/t+(3/2 a-1)/y[t] t^3==g[t];
pfun=ParametricNDSolveValue[{ode/.{a->3/4,b->5},y[1]==1},y,{t,1,2},{n}]

Plot[Evaluate[Table[pfun[n][t],{n,Range[5]}]],{t,1,2},
    PlotRange->{Automatic,{-10,10}},AxesLabel->{"time","y(t)"},BaseStyle->14]

Mathematica graphics

The above gives solution for n=1,2,3,4,5 and for specific a and b.

To make a,b change also, you can add Manipulate with sliders for all of these. Notice that different n values give solutions that blows up.

Update Here is a Manipulate with sliders. For some n values, NDSolve will have trouble making solution. That is why Quiet is added below. So you can skip that n value and go to the next. You can change the default ranges for the slider as you know better what you want for these.

enter image description here

Clear["Global`*"]
Manipulate[
 Module[{g, pde, pfun, y, t, n},
  g = ((1 - b) y[t]^2/t^n + 1/t^(2 + n))^n;
  ode = y'[t] + 3/2 (a - b) y[t]/t + (3/2 a - 1)/y[t] t^3 == g;
  pfun = Quiet@
    ParametricNDSolveValue[{ode, y[t0] == y0}, 
     y, {t, t0, maxTime}, {n}];
  Grid[{{pfun},
    {Quiet@Plot[Evaluate[pfun[n0][t]], {t, t0, maxTime},
       PlotRange -> {Automatic, {-maxY, maxY}},
       AxesLabel -> {"time", "y(t)"}, BaseStyle -> 14, 
       ImageSize -> 400,
       GridLines -> Automatic, GridLinesStyle -> LightGray, 
       PlotStyle -> Red]}
    }, Spacings -> {2, 2}]
  ]
 ,
 {{a, 3/4, "a"}, 0, 1, 1/4, Appearance -> "Labeled"},
 {{b, 5, "b"}, 1, 10, 1/4, Appearance -> "Labeled"},
 {{n0, 3, "n"}, 1, 10, 1, Appearance -> "Labeled"},
 {{t0, 1, "t0"}, 0, 10, 1, Appearance -> "Labeled"},
 {{maxTime, 2, "max time"}, 0, 10, 1, Appearance -> "Labeled"},
 {{maxY, 10, "max Y range"}, 1, 1000, 1, Appearance -> "Labeled"},
 {{y0, 1, "y(0)"}, 0, 10, 1, Appearance -> "Labeled"},
 TrackedSymbols :> {a, b, n0, t0, y0, maxTime, maxY}
 ]
$\endgroup$
2
  • $\begingroup$ thank you vert much. $\endgroup$ Jan 18, 2022 at 18:30
  • 2
    $\begingroup$ @FelipeDura if the answer by Nasser solves the problem you described, perhaps you should consider accepting it by clicking the checkmark on the left $\endgroup$
    – user49048
    Jan 18, 2022 at 23:05

Your Answer

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

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