# Getting error NDSolve::ndsz [closed]

When I evaluate the code shown below, it gives an error:

NDSolve::ndsz: At x == -0.00001, step size is effectively zero; singularity or stiff system suspected.

W := (2*Pi*3*10^14)
CC := 3*10^8
vt := ((2*T/me)^(1/2))
me := 9.11*10^-31
T := 1.6*10^-15
Wc := 1.6*10^-19/me
L := 0.00001
wp := W*Sqrt[(1 - x/L)]
Om := Wc
e0 := 8.85*10^-12
LnLumbda := 10
k := W/CC (1 - (1 - x/L)/(1 + (Wc)/W))^(1/2)
R := ((1 - x/L)*W^2*(1.6*10^-19)^2*Pi*Sqrt[me]*LnLumbda)/( T^(3/2)*e0)
q := (W + 2 I R - Om)/vt
F := q/k
sol =
NDSolve[
{(y''[x] +
(W^2/ (CC^2) + ((W (wp)^2)/((CC^2) vt k ))
((E^-F^2 (-π Erfi[F] + Log[-(1/F)] + Log[F]))/Sqrt[π])) y[x]) == 0,
y'[-L] == 0, y[-L] == 10},
y, {x, -L, L}]


I will appreciate any help.

• So what's the problem? 1. Does the equation/system of equation actually have solution? 2. Can you get the solutions? – user202729 Dec 4 '17 at 6:23
• Are you sure, that your parameter definitions are right? With q you introduce the imaginary unit I. Plot the cofactor to y[x] in your diffequation to see it's highly oscillatory and complex for x<0. – Akku14 Dec 4 '17 at 7:42
• After solving the code, it's error has:NDSolve::ndsz: At x == -0.00001, step size is effectively zero; singularity or stiff system suspected – Nagi Dec 5 '17 at 9:50

y''[x] + (W^2/(CC^2) + ((W (wp)^2)/((CC^2) vt k)) ((E^-F^2 (-π Erfi[F] + Log[-(1/F)] + Log[F]))/Sqrt[π])) y[x] == 0 // N // Chop


yields

y[x] (-((∞ (1. - 100000. x))/Sqrt[Sign[1. - 0.999907 (1. - 100000. x)]]) + 3.94784*10^13) + (y^′′)[x] == 0


The infinity is the problem. Rationalizing your data and increasing the WorkingPrecision did not help.

• so what does it mean? do I change the parameters or other things? – Nagi Dec 5 '17 at 10:03
• Your data is way to jumpy for NDSolve to handle. Rationalize your values and plot the coefficient of y[x] in your ode from -L to L to see what I mean. You need a much smoother function than what you have. – Bill Watts Dec 5 '17 at 23:13
• Thankful.Regards. – Nagi Dec 7 '17 at 5:18