1
$\begingroup$

I have two differential equations: $da/dt = a (.3 a^{-3} + .7)^{1/2}$ and $d \tau /dt = 1/a$. The initial conditions are $t = 0$; $a = 1$ and $\tau = 0$, respectively.

How can I solve the equations in Mathematica? I need to calculate different values of $a$, $t$ and $\tau$ also plot $\tau$ vs $a$.

$\endgroup$
  • $\begingroup$ Thanks a lot, @David :) $\endgroup$ – Photon Nov 28 '18 at 8:36
2
$\begingroup$

How can I solve the equations in Mathematica

One way could be to use NDSolve

ClearAll[a,t,tau];
ode1   = a'[t]   == a[t] Sqrt[ (3/10  * 1/a[t]^3 + 7/10)];
ode2   = tau'[t] == 1/a[t];
ic1    = a[0]    == 1;
ic2    = tau[0]  == 0;
sol    = NDSolve[{ode1,ode2,ic1,ic2},{a[t],tau[t]},{t,0,5}]

Mathematica graphics

And now you can plot them

 Plot[Evaluate[a[t] /. sol], {t, 0, 5}, PlotRange -> All]

Mathematica graphics

 Plot[Evaluate[tau[t] /. sol], {t, 0, 5}, PlotRange -> All]

Mathematica graphics

Is it possible to plot a[t] vs /tau?

You can try to use ParametricPlot for this.

 ParametricPlot[{Evaluate[a[t]], Evaluate[tau[t]]} /. sol, {t, 0, 0.5}]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Thanks a lot for your effort. But still now I found error when trying to draw a[t] vs /tau. Can you please resolve this? $\endgroup$ – Photon Nov 28 '18 at 9:37
  • $\begingroup$ Is it possible to plot a[t] vs /tau? $\endgroup$ – Photon Nov 28 '18 at 10:18
  • $\begingroup$ @Photon try ParametricPlot to plot a(t) vs. tau(t) $\endgroup$ – Nasser Nov 28 '18 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.