# Problems with NDSolve and NDSolveValue [closed]

I have solved, with NDSolve, a differential equation. Now, I want to use this numerical solution in another system of differential equations, but I don't now how to do it. Could you help me?

Edit1: The first equation is this

Friedmann1 = Cu/Derivative[y][x]^2 + R/(y[x]^2 Derivative[y][x]^2) + M/(y[x] Derivative[y][x]^2) + (\[CapitalLambda] y[x]^2)/Derivative[y][x]^2;


which I solve using

s1\[CapitalLambda]CDM = DSolve[{Friedmann1 == 1, y == 1}, y, {x, -0.9637, 0.9637}][]


Up to now there are not problems: I have solved and plotted the solution. Now, I will consider the following equations

CovariantDM = DMm'[t] + 3 y'[t]/y[t] DMm[t] + Q[t];
CovariantDE = DE'[t] + 3 y'[t]/y[t] DMm[t] (1 + w[t]) - Q[t];
Variance0 = w'[t]/w[t] + DE[t]/Q[t]


Which I want to solve using

solmod1a = NDSolve[{CovariantDE == 0, CovariantDM == 0, Variance0 == 0,
DMm == 0.25, DE == 0.7, w == -1}, {DMm, DE,
w}, {t, -.9798, 0.97}][]


I would like to use the numerical solution that I have already obtained in the last line of code, as a input. Is this possible? Thank you for your patience.

Edit2: I solved my previous problem using NDSolveValue as suggested here. The equation has been solved using

a = NDSolveValue[{Friedmann1 == 1, y == 1}, y, {x, -0.93, 0.93}]


When I try to put the solution in another system of ODE using this code

In:= CovariantDM = DM'[t] + 3 a'[t]/a[t] DM[t] + Q[t];

In:= CovariantDE = DE'[t] + 3 a'[t]/a[t] DE[t] (1 + w[t]) - Q[t];

In:= Variance0 = w'[t]*Q + DE[t]*w[t]

Out= DE[t] w[t] + Q Derivative[w][t]

In:= Q = 0;

In:= {DMsol, DEsol, wsol} = NDSolve[{CovariantDE == 0, CovariantDM == 0, Variance0 == 0,
DM == 0.25, DE == 0.7, w == -0.85}, {DM, DE, w}, {t, -0.93, 0.93}]


where a[t] has been obtained with the first equations I solved, I obtain

During evaluation of In:= NDSolve::nlnum: The function value {0.315013 -0[0.],0.750031 +0[0.],-0.595} is not a list of numbers with dimensions {3} at {t,DE[t],DM[t],w[t],(DE^\[Prime])[t],(DM^\[Prime])[t],(w^\[Prime])[t]} = {0.,0.7,0.25,-0.85,0.,0.,0.}.

During evaluation of In:= NDSolve::icfail: Unable to find initial conditions that satisfy the residual function within specified tolerances. Try giving initial conditions for both values and derivatives of the functions.

During evaluation of In:= NDSolve::nlnum: The function value {0.315013 -0[0.],0.750031 +0[0.],-0.595} is not a list of numbers with dimensions {3} at {t,DE[t],DM[t],w[t],(DE^\[Prime])[t],(DM^\[Prime])[t],(w^\[Prime])[t]} = {0.,0.7,0.25,-0.85,0.,0.,0.}.

During evaluation of In:= NDSolve::icfail: Unable to find initial conditions that satisfy the residual function within specified tolerances. Try giving initial conditions for both values and derivatives of the functions.

During evaluation of In:= Set::shape: Lists {DMsol,DEsol,wsol} and {} are not the same shape.

Out= {}


Have you got any advice? Thank you again for your patience.

## closed as off-topic by Chris K, xzczd, Henrik Schumacher, rhermans, Lukas LangJul 7 '18 at 15:06

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Chris K, xzczd, Henrik Schumacher, rhermans, Lukas Lang
If this question can be reworded to fit the rules in the help center, please edit the question.

• Could you please include details and code? As is, it is impossible to answer your question meaningfully. – MarcoB Jul 2 '18 at 4:11
• I am sorry! I have added some lines of code, I hope that they are enough! – Saramago Jul 6 '18 at 0:08
• I think you are looking for NDSolveValue. Have a look in the documentation. – user21 Jul 6 '18 at 6:12
• This completely solves my question...thank you! – Saramago Jul 6 '18 at 12:29
• The error message talks about 0[t]. That's because you have Q[t] in your equations, but set Q=0. Q can't be both a function and a constant here. – Chris K Jul 6 '18 at 13:49