Question: why different results?

Dear guys! Please look at the two following ways to solve a same equation and tell me why the results are different:

The initial conditions and the equation for both ways are:         m := 0.22: k := 0.03: n := 0.35: h := 0.63:

> 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))):

The first model:

> yp := implicitdiff(eq(z), H, z):

> ode := diff(H(z),z)=subs(H=H(z),yp):

> sol := dsolve(ode, H(0)=h, numeric, output = listprocedure, stiff = true);

> Ynum := subs(sol,H(z));

> Ynum(0.57);

The second model:

> Y := z->if not type(z,numeric) then 'procname(z)' else fsolve(eq(z), H=max(h*sqrt(z^3*m),h) ) end if;

> Y(0.57);

Apparently, the second model is more accurate, becuse it is more like the physically data that I have.

 

Please Wait...