Hi,
I have been trying to get a numerical solution to the following ode system for weeks. I am new to Maple, and I think my issues might be with the coding rather than the maths.
I get the error message:
Error, (in dsolve/numeric/checksing) ode system has a removable singularity at t=0. Initial data is restricted to {v(t) = 0., Phi(t) = 0.}
I know there is a singularity at t=0, so I tried setting the 'range' option to something just above 0, but it is still not working.
Here is my worksheet (without the output, and I am using Maple 10 classic). Sorry, it is pretty ugly:
restart;with(DEtools):with(plots):with(linalg):infolevel[dsolve]:=4:Digits:=20;
> k:=0.065;
> h:=0.5;
> H0:=100*h;
> K:=(omm,omv)->-H0^2*(1-omm-omv);
> Lambda:=(omv)->3*H0^2*omv;
> G:=6.673e-11;#m^3 kg^-1 sec^-2
> a0:=(omm)->25000*omm*h^2:
> a0(1);
> adotarad:=(t)->1/t;
> adotamat:=(t)->(2/t);
t = conformal time:
> arad:=(t)->t/a0(.3):
> amat:=(t)->t^(2)/a0(.3):
> raddom:=loglogplot(arad(t),t=1e-6..1,axes=framed):
> matdom:=loglogplot(amat(t),t=1..a0(.3)^(3/2),axes=framed):
> #display(raddom,matdom);
> rho_dm:=0.3: rho_r:=0.7:
> de1:=diff(Theta0(t),t)=-k*Theta1(t)+(3*adotamat(t))^(-1)*(k^2+3*adotamat(t)^(2)*Phi(t)-4*evalf(Pi)*G*(rho_dm*delta(t)+ 4*rho_r*Theta0(t))):
> de2:=diff(Theta1(t),t)=-k/3*Phi(t)+k/3*Theta0(t):
> de3:=diff(delta(t),t)=-adotamat(t)^(-1)*(k^2+3*adotamat(t))^2*Phi(t)-4*evalf(Pi)*G*rho_dm*delta(t)+ 16*evalf(Pi)*G*rho_dm**rho_r*Theta0(t)-I*k*v(t):
> de4:=diff(v(t),t)=I*k*Phi(t)-adotamat(t)*v(t):
>de5:=diff(Phi(t),t)=3*adotamat(t)*(4*evalf(Pi)*G*amat(t)^2*rho_dm*delta(t)+16*evalf(Pi)*G*amat(t)^2*rho_r*Theta0(t))-(k^2+3*adotamat(t)^2)*Phi(t):
> deqs := de1,de2,de3,de4,de5;
> ics := Theta0(0)=1e-3;Theta1(0)=1e-3;Phi(0)=0.002;v(0)=0.1;delta(0)=0.003;
> #ics := Phi(0)=0.1;Theta0(0)=0.001,Theta1(0)=0.001,delta(0)=0.001,v(0)=0.1;
> fns := Phi(t),Theta0(t),Theta1(t),delta(t),v(t);
> eqsol := dsolve({deqs,ics},{fns},numeric,'range'=1..1e6);
Any help/comments hugely appreciated.
Peter
Singularity at t=0
Your system of ODEs has a singularity at t=0, so specifying ICs there can be problematic. Are you sure this is the problem you want to solve? You might be able to get away with changing the initial time to a "small" time, but I'll use t=1 just to check that Maple is capable of giving a solution to your system.
While I have not done a full analysis, this system has all the markings of a stiff system. Some coefficients are 1e-10, some are 1e-17, and others are order 1. This is likely to make this problem very difficult to solve.
As for the Maple, the only problem I see is the definition of the initial conditions (ics). You have only one IC, followed by separate equations. Change the semi-colon's to commas, and you will have a full set of ICs.
Making the syntax change and changing the initial time to t=1, Maple will give a numerical solution.
Watching the information from infolevel, I also see that the equations are complex valued? Is this correct?
Here is some output from the numerical solver:
Here's a plot of the real part of each of the 5 components of the solution. Note that I have scaled Theta0 and v to show more detail of the other components. (Call me lazy. I did not re-upload the plot after I changed the labels in the legend.)
odeplot( eqsol, [[t,Re(Phi(t))],[t,Re(Theta0(t))/5],[t,Re(Theta1(t))],[t,Re(delta(t))],[t,Re(v(t))/10]], t=0.5..10, legend=["Phi","Theta0/5","Theta1","delta","v/10"] );
I hope this is helpful.
Doug
Thanks very much for your
Thanks very much for your response Doug. The point about trying to start things off in a singularity is clear to me now!
Yes, the solutions should be complex-valued. They represent the evolution of matter density perturbations in the universe, and these oscillated in the early universe when things were much hotter.
I need to think about the time scale issue now. It is a great help just to have the numerical integration working.
One more quick question: does odeplot have a logarithmic axes option?
Peter
log plot from odeplot
Peter,
I do not believe odeplot has an explicit log-plot option. But, you can create this by putting the log of whichever component you want to have plotted. One of the nice things about odeplot is that you can specify any combination of dependent and independent variables in the ODE system. I have used this to study conserved quantities, phase plots, .... With a little practice, I'm confident you will be able to produce a plot that suits your needs. If not, post what you have and see if someone on Mapleprimes can help you out.
Good luck,
Doug
axis=[mode=log]
You can pass the option axis=[mode=log] to plots[odeplot] and it will use a loglog plot. Use axis[2]=[mode=log] to affect just the y-axis. See ?plot,axis