Question: fsolve float issue

Dear guys, Can anyone tell me why my program does not work for some initial values? All my equations are:

> alpha := (6*h^2)^(1-n)*(1-k)^(1-n)*((1-m+k)/(2*n-1-k));

> eq := z-> 1=(m*(1+z)^3-k*(1+z)^2)*h^2/(H^2)+(((2*n-1)-(k*(1+z)^2*h^2/H^2))*((1-m+k)/(2*n-1+k))*((((H^2/h^2)-k*(1+z)^2)/(1-k))^(n-1)));

> Y := z->if not type(z,numeric) then 'procname(z)' else (fsolve(eq(z), H=h)) end if;

> l := dsolve({D(L)(z) = L(z)/(1+z)+(1+z)*h/Y(z), L(0)=0}, type=numeric, range=0..5, known=Y);

This works for example for initial values like:

> m := 0.27: k := -0.02: n := 0.9: h := 0.72:

but does not work if I change for example n:=0.9 to n := 0.5 and I get an error as:

Error, (in f) unable to store 'HFloat(0.72)/fsolve(1 = HFloat(0.150336)/H^2-HFloat(0.36806399999999995)/(H^2*(1.89118857419511*H^2+HFloat(0.019607843137254898))^.5), H = .72)' when datatype=float[8]

How can I solve this problem? Thanks a lot!

Please Wait...