Preben Alsholm

13728 Reputation

22 Badges

20 years, 249 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@goli The problem is that the starting guess for z = 0 is H = 0 and you are dividing by H^2 in eq(z).

You can modify the starting guess to e.g. H=max(h*sqrt(z^3*m),h) as in the following.


restart;
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=max(h*sqrt(z^3*m),h) ) end if;
m := 0.34: k := 0.04: n := -0.34: h := 0.69:
l := dsolve({D(L)(z) = L(z)/(1+z)+(1+z)*h/Y(z),L(0)=0}, type=numeric,range=0..2, known=Y);
A1 := ((0.35/Y(0.35))*(int(1/Y(z), z = 0 .. 0.35))^2)^(1/3);   
R := h*evalf(sqrt(m)*(int(1/Y(z), z = 0 .. 1091.3)));




@goli For large values of z the first term in rhs(eq(z)) dominates. From this you get the idea to use the following instead:

fsolve(eq(z), H=h*sqrt(z^3*m))

@goli For large values of z the first term in rhs(eq(z)) dominates. From this you get the idea to use the following instead:

fsolve(eq(z), H=h*sqrt(z^3*m))

You have the variable z in series(gen, z, 8), but no variable z in gen, and I don't get the error message you get, but the result FAIL.

@Dennis_B If you solve numerically the easiest way to find M and integrals of M is to include the equation

eqM:= M(t)=z1(t)^2 * sin( z5(t) * t)^2;

#in the call to dsolve/numeric.

#like this

num:=dsolve({sys,eqM,z1(0)=z10,z2(0)=z20,z3(0)=z30,z4(0)=z40,z5(0)=z50},numeric,parameters=[A,d,g,k,m,v,z10,z20,z30,z40,z50],output=listprocedure);
#Choosing values for constants.
par:=[A = 1, d = 1, g = 10, k = 1, m = 1, v = 1, z10 = 0, z20 = 1, z30 = 0, z40 = 1, z50 = 0];
num(parameters=par);
Mn:=subs(num,M(t));
evalf(Int(Mn,0..5));
plot(Mn,0..10);

@Dennis_B If you solve numerically the easiest way to find M and integrals of M is to include the equation

eqM:= M(t)=z1(t)^2 * sin( z5(t) * t)^2;

#in the call to dsolve/numeric.

#like this

num:=dsolve({sys,eqM,z1(0)=z10,z2(0)=z20,z3(0)=z30,z4(0)=z40,z5(0)=z50},numeric,parameters=[A,d,g,k,m,v,z10,z20,z30,z40,z50],output=listprocedure);
#Choosing values for constants.
par:=[A = 1, d = 1, g = 10, k = 1, m = 1, v = 1, z10 = 0, z20 = 1, z30 = 0, z40 = 1, z50 = 0];
num(parameters=par);
Mn:=subs(num,M(t));
evalf(Int(Mn,0..5));
plot(Mn,0..10);

@smokeybob A particular solution is usually defined as any solution to the inhomogeneous equation. Thus replacing the arbitrary constants by any values (e.g. zero) will give you a particular solution.

@smokeybob A particular solution is usually defined as any solution to the inhomogeneous equation. Thus replacing the arbitrary constants by any values (e.g. zero) will give you a particular solution.

@Peter_Parker Sorry no typing error,  but the order in series is the problem. See my answer to the question asked separately.

@Peter_Parker Sorry no typing error,  but the order in series is the problem. See my answer to the question asked separately.

I was puzzled by the empty list in the procedure

proc(x,y) []; evalf(y+I*10^(-x)); end proc

What purpose does that serve?

@PatrickT It is interesting that the picture displayed on MaplePrimes has the label "Right" appearing horizontally.

It is correctly displayed on the monitor screen in Maple 15.

@PatrickT It is interesting that the picture displayed on MaplePrimes has the label "Right" appearing horizontally.

It is correctly displayed on the monitor screen in Maple 15.

You can get vertical labels by using labeldirections.

dualaxisplot(plot(x^3,x=-1..1,labels=["Bottom","Left"],labelfont=["Times","Roman",15],labeldirections=[default,vertical]),
plot(x^5,x=-1..1,labels=["Bottom","Right"],labelfont=["Times","Roman",15],labeldirections=[default,vertical]),
axis=[gridlines=[5,majorlines=2]],title="Top",titlefont=["Times","Roman",15]);

You can get vertical labels by using labeldirections.

dualaxisplot(plot(x^3,x=-1..1,labels=["Bottom","Left"],labelfont=["Times","Roman",15],labeldirections=[default,vertical]),
plot(x^5,x=-1..1,labels=["Bottom","Right"],labelfont=["Times","Roman",15],labeldirections=[default,vertical]),
axis=[gridlines=[5,majorlines=2]],title="Top",titlefont=["Times","Roman",15]);

First 204 205 206 207 208 209 210 Last Page 206 of 230