# Syntax error using Plot

Why is the error coming and what should I do to resolve it The code is

sol1=DSolve[{2*y'[r]+r*y''[r]==-.262468*(-13.60r+14.3996)*y[r],
y[0.0001]==1,y'[30]==0},y[r],r]

Plot[ Evaluate[y[r]/ sol1],{r,.000000001,.000001}]

• Note that sol1 and sol are 2 different variables. Oct 26 '20 at 19:41
• @DanielHuber i changed it but now this is coming Oct 26 '20 at 19:59
• when i used Plot[ Evaluate[y[r]/. sol1],{r,.000000001,.000001}] still error was coming Oct 26 '20 at 19:59
• Please edit your question and add the code as text, not an image, so others can copy/paste and reproduce the problem. Oct 26 '20 at 20:15
• Use DSolveValue instead so you don't have to muck around with replacement rules. Oct 26 '20 at 20:36

Your code contains: ry''[r]. You need a space between r and y.

But this does not solve your problem. DSolve seems not able to solve this. Maybe there is no closed form solution.

Trying to use NDSolve indicates that the system is unstable. The reason is that y'[30] is too far out, y'[10] will work.

sol = y /.
NDSolve[{2 y'[r] + r  y''[r] == -.262468*(-13.60 r + 14.3996)*y[r] ,
y[0.0001] == 1, y'[10] == 0}, y, {r, .000000001, 10}][[1]]

Plot[sol[r], {r, .000000001, .0001}]


DSolve is an exact solver, and exact solvers sometimes cannot solve equations with inexact (floating-point) coefficients because round-off error makes things that should be equal or cancel fail to do so. Use exact input and the system can be solved (after all, it's linear).

sol1 = DSolve[
Rationalize@{
2*y'[r] + r*y''[r] == -.262468*(-13.60 r + 14.3996)*y[r],
y[0.0001] == 1, y'[30] == 0},
y, r];

Plot[Evaluate[y[r] /. sol1], {r, .000000001, .0001}]


Generic solution, followed by specialization to OP's case:

sol2 = DSolve[
{2*y'[r] + r*y''[r] == c*(m r + b)*y[r], y[r1] == 1, y'[r2] == 0},
y, r];

Block[{c, m, b, r1, r2},
c = -.262468;
m = -13.60;
b = 14.3996;
r1 = 0.0001;
r2 = 30;
Plot[Evaluate[y[r] /. sol2], {r, .000000001, .0001}]
]