Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DSolve[{y''[x] + 1/x y'[x] + y[x] == 0, y[0] == 1, y'[0] == 0}, y[x], x]
- {{y[x] -> BesselJ[0, x]}}
- sol = NDSolve[{y''[x] + 1/x y'[x] + y[x] == 0, y[0] == 1, y'[0] == 0}, y[x], {x, 0, 10}]
- Power::infy: Infinite expression 1/0. encountered. >>
- Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered. >>
- NDSolve::ndnum: Encountered non-numerical value for a derivative at x == 0.`. >>
- sol = DSolve[{y''[z] + Exp[2 z] y[z] == 0}, y[z], z]
- ndsol = NDSolve[{x y''[x] + y'[x] + x y[x] == 0,
- y[0] == 1, y'[0] == 0}, y[x], {x, 0, 10},
- Method -> {"EquationSimplification" -> "Residual"}];
- dsol = DSolve[{x y''[x] + y'[x] + x y[x] == 0, y[0] == 1, y'[0] == 0},
- y[x], {x, 0, 10}];
- Plot[y[x] /. Join[dsol, ndsol] // Evaluate, {x, 0, 10},
- PlotStyle -> {AbsoluteThickness[5], Automatic}]
- y''[x]/1
- y''[0] + y''[0]/1 + y[0] == 0 /. y[0] -> 1
- Solve[%, y''[0]] // Flatten
- (*{(y''[0] -> -(1/2)}*)
- pde = y''[x] + Piecewise[{{-1/2, x == 0}, {y'[x]/x, x > 0}}] + y[x] == 0
- sol = NDSolve[{pde, y[0] == 1, y'[0] == 0}, y[x], {x, 0, 10}] // Flatten;
- Plot[{BesselJ[0, x], y[x] /. sol}, {x, 0, 10}]
Add Comment
Please, Sign In to add comment