1

I am trying to evaluate the DSolve and compare it to my Runge-Kutta code.

DSolve [{y[X]*y'[X] - 7 y[X] + 12 X == X^(3/2), y[0] == 1 }, y[X], X]

What is wrong with this equation?

  • f[y_, X_] := (7 y - 12 X + X^(3/2)) ((y)^-1) ; N1 = 200; h = (2.5 - 0)/N1;

    w = Table [0, {m, 1, N1}]; w[[1]] = 1; w For [n = 2, n <= N1, n++, k1 = hf[w[[n - 1]], h(n - 1)]; k2 = h * f[w[[n - 1]] + 1/2k1, h(n - 1) + h/2]; k3 = h * f[w[[n - 1]] + 1/2k2, h(n - 1) + h/2]; k4 = h f[w[[n - 1]] + k3, nh]; w[[n]] = w[[n - 1]] + 1/6(k1 + 2k2 + 2 k3 + 2k4);] w // N DSolve [{y[X]*y'[X] - 7 y[X] + 12 X == X^(3/2), y[0] == 1 }, y[X], X]

    – Srijan Banjara Mar 03 '22 at 21:58
  • Do you get any errors? It’s not clear what the problem is here. – CA Trevillian Mar 03 '22 at 21:58
  • DSolve::deqn: Equation or list of equations expected instead of True in the first argument {12 X-7 y[X]+y[X] (y^[Prime])[X]==X^(3/2),True}. – Srijan Banjara Mar 03 '22 at 22:00
  • Srijan, welcome to this forum. When you place a question and realize that forgot something, please edit the question instead of adding comments. Your pure code comment is confusing. – Gustavo Delfino Mar 03 '22 at 22:27
  • @SrijanBanjara That error message makes me think you previously entered y[0] = 1 by mistake. Clear[y] or y[0] =. should fix that, but won't change the fact that there is likely no analytic solution. – MathIsFun7225 Mar 04 '22 at 00:02
  • Related: https://mathematica.stackexchange.com/questions/40314/error-entering-equation-in-dsolve, https://mathematica.stackexchange.com/questions/46214/why-my-differential-equations-become-true – Michael E2 Mar 04 '22 at 07:42

1 Answers1

2

You can solve it numerically with NDSolve:

sol = NDSolve[{y[x]*y'[x] - 7 y[x] + 12 x == x^(3/2), y[0] == 1}, y[x], {x, 0, 10}]

To visualize:

Plot[y[x] /. sol, {x, 0, 10}]
bill s
  • 68,936
  • 4
  • 101
  • 191