Skip to main content
Post Closed as "Not suitable for this site" by Michael E2, David G. Stork, creidhne, MarcoB, bbgodfrey
edited title
Link
David G. Stork
  • 41.8k
  • 3
  • 34
  • 100

I have a problem about this code which numerical Numerical and analytical solutions to be compare!do not agree

Source Link

I have a problem about this code which numerical and analytical solutions to be compare!

Hi everyone could anyone have look why this code is not running?

    Clear["Global`*"]
   eqn = {(s''[x]/s[x]) + ((3 \[Gamma])/2 - 1) (s'[x]/s[x])^2 - (3 \[Gamma]*f)/2 == 0};
  sol = NDSolveValue[{eqn /. {f -> 0.7, \[Gamma] -> 1}, s'[1] == 1,s[1] == 1}, s[x], {x, 0.1, 8}];
 pp1 = Plot[Evaluate[{s[x] /. {sol {f -> 0.7, \[Gamma] -> 1}}}], {x, 0.1, 8}, 
 PlotStyle -> {Opacity[.2], AbsoluteThickness[5]}];
  sol1 = DSolve[{(w''[t]/w[t]) + ((3 \[Gamma])/2 - 1) (w'[t]/w[t])^2 - (3\[Gamma]*p)/2 == 0, w'[1] == 1, w[1] == 1}, w[t], t];
  p = 0.7; \[Gamma] = 1;
  pp2 = Plot[w[t] /. sol1, {t, 0.1, 8}, PlotStyle -> {Dashed, Red}];
  Show[pp1, pp2]