The equation I want to solve numerically with WolframCloud is:
z[t_] := Exp[2*Sqrt[L/3]*t]
Eq1 = -40/9*L-20/3*y''[t]/y[t]+2/3*y'[t]^2/y[t]^2-6*z'[t]*y'[t]/(z[t]*y[t])+11/6*z'[t]^2/z[t]^2-360/7*1/y[t]^2+97/21*1/(y[t]^2*z[t])==0
I want to solve it for y[t] only, and then verify that it gives y[t] such that if I want to solve this equation for z[t], it returns the correct exponential function. To do so, I use the following code:
Clear[F,R,y]
L = 0.038;
sol0 = NDSolve[{Eq1, y[0]==0.1, y'[0]==5.5},y[t],{t, 0, 1}];
R[t_]:=Evaluate[y[t]/.sol0]
Eq2 =-40/9*L-20/3*R''[t]/R[t]+2/3*R'[t]^2/R[t]^2-6*F'[t]*R'[t]/(F[t]*R[t])+11/6*F'[t]^2/F[t]^2-360/7*1/R[t]^2+97/21*1/(R[t]^2*F[t])==0;
sol = NDSolve[{Eq2,F[0]==1},F[t],{t,0,10},MaxSteps->10000][[1]];
Plot[{Log[Evaluate[F[t]/.sol]], 2*Sqrt[L/3]*t},{t,0,1}]
As you see, I plot only the log of the function so it should give two superimposed lines. But it gives me this:
We can see that until $\sim 0.6$ it gives the correct behavior, but I can't explain what is going on with my code to give a wrong answer... Have I done something wrong in my code?
EDIT: After having played with the parameters, it seems that the point where F[t] deviates from the line $2 \sqrt{\frac{L}{3}} t$ is exactly the middle of the domain of definition of R[t]. In fact, R[t] has roughly the shape of $-at^2+b$, and so its domain of definition has a maximum right at its half. I don't know what it means but if anyone has an idea...
AccuracyGoal
and addMethod -> {"StiffnessSwitching"},
to help., Your second ode is also stiff. May be more special options are needed. I get in V 13.0.1NDSolve::ndsz: At t == 1.3637473398450544, step size is effectively zero; singularity or stiff system suspected.
$\endgroup$R = NDSolveValue[{Eq1, y[0] == 0.1, y'[0] == 5.5}, y, {t, 0, 1}]
and now you do not need to doR[t_]:=Evaluate[y[t]/.sol0]
$\endgroup$