## 13613 Reputation

19 years, 229 days

## The integral is a problem...

It seems that the basic problem is the presence of an integral. Besides, in the ODE you have D(phi(t))(t).

I have corrected that, so here is what I have,

restart;
dtOM:= (phi,a)-> -alpha*M^(alpha+4)/phi^(alpha+1) + 1/(3*Pi^2)*int(2*g^2*phi^2*k^4*(a*sqrt*(g^2*phi^2+k^2)/T+1)*exp(-a*sqrt*(g^2*phi^2+k^2)/T)*(g^2*phi^2+k^2)^(-3/2), k= 0..infinity):
RhoDE:= (phi,a)->M^(4(alpha+1))/phi^alpha+D(phi)/2*a^2:
RhoDM:=a-> C/a^3:
RhoR:=a->Pi^2/15*(T/a)^4:
alpha:=1: M:=1: g:=1: T:=1: C:=1:
RhoDE(phi,a)(t);
RhoDM(a(t));
RhoR(a(t));
dsys:={D(a)(t)=sqrt(RhoDE(phi,a)(t)+ RhoDM(a(t)) + RhoR(a(t)))*a(t),
D(D(phi))(t) + 3*a(t)*D(phi)(t)/D(a)(t)*dtOM(phi(t),a(t))=0,
a(1000)=2,
phi(1000)=3,
D(phi)(1000)=4
};
dsolve(dsys,[a(t),phi(t)], numeric);

resulting in a warning and an error message:

Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters)
Error, (in DEtools/convertsys) unable to convert systems with integrals containing the dependent variables

The warning may have to do with the variable of integration. The error message is self-explanatory.

Preben Alsholm

## Powers ARE too high...

By looking at the procedure 'residue' in line 8 you will see the loop

for i from 0 to 5 do

If you substitute for 5 a higher number, you get an answer.

In experimenting with this be aware that some things are remembered, so a restart can be necessary.

Try the following, where 'residue2' is simply 'residue' with 5 replaced by 6.

restart;
residue((x^7+1)^4/x^30, x=0);
showstat(residue);
residue2:=subs(5=6,eval(residue));
showstat(residue2);
debug(residue2);
residue2((x^7+1)^4/x^30, x=0);
restart;
residue2:=subs(5=6,eval(residue));
residue2((x^7+1)^4/x^30, x=0);

You may even make yourself a new procedure that takes the top loop variable as an optional third argument:
I have used 2 forget commands to avoid a restart and to make behavior consistent.

restart;
Residue:=proc(f, a::(name = anything),n::posint:=5)
forget(residue); forget(series);
if n=5 then residue(f,a) else subs(5=n,eval(residue))(f,a) end if
end proc;
Residue((x^7+1)^4/x^30, x=0);
Residue((x^7+1)^4/x^30, x=0,6);
Residue((x^7+1)^4/x^30, x=0);

Preben Alsholm

## Shifting from using hardware floats to s...

It sounds like with Digits <=15 computations are done with hardware floats, whereas if Digits > 15 Maple has to use software floats.

See e.g. the help page for evalhf.

Preben Alsholm

 First 158 159 160 Page 160 of 160
﻿