# Problem with solving a differential equation [closed]

I need to solve the following differential equation:

NDSolve[{R[r, t], R[r, 0] == r/1000}, R, {t, 0, 30}, {r, 1, 30}]


Where R[r,t] goes like:

D[R[r, t], t] == Sqrt[(2*G*M1[r])/R[r, t] + (2 c^2*λ*(R[r, t])^2)/3 + 2 c^2* E1[r]]


M1[r] and E1[r] are exact valued functions which are solved. I need to now get a solution for R[r,t] based on the values of M1[r] and E1[r], then vary R[r,t] in time keeping it constant in r.

The problem is that when I run this, I get an error message saying that the max number of steps was performed without a solution being reached. I've scaled all my units down and set the WorkingPrecision to 1, wherein I was told that the precision of the problem at hand was less than 1.

Any thoughts?

-
to me this looks like an ordinary differential equation which is parameterized by r. It doesn't seem to make sense to include r as an additional independent variable. I think this question is similar to this. Maybe you find the answers there helpful. Otherwise you probably might want to edit you answer, clarify your question and/or provide a self-contained example... –  Albert Retey Feb 12 at 17:08
Hi there, I've updated the problem. Apologies for that. –  Gokotai Feb 12 at 18:54
Your use of NDSolve doesn't include any derivatives at all! Emulate the examples given in its help page. –  whuber Feb 12 at 20:07
@Albert Despite the appearance of your helpful reply/comment (which I upvoted), I have voted to close this question on the grounds that it is unintelligible. –  whuber Feb 13 at 14:55
@whuber: I have no complaints, it doesn't look like the OP is very interested in improving his question (or getting answers). My first impression was he would be... –  Albert Retey Feb 13 at 19:23
show 1 more comment

## closed as too localized by whuber, m_goldberg, rcollyer, Oleksandr R., Yves KlettFeb 14 at 7:19

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Here is what I think you are trying to solve: an ordinary differential equation with 4 parameters (called c1 to c4 in the following). The values of these 4 parameters depend on other parameters, among them r. Because you don't tell us anything about their values or the functions you use to determine them, I'm just choosing some values, and for those NDSolve works with no error/warning messages:

NDSolve[{
D[u[t], t] == Sqrt[c1*u[t]^2 + c2/u[t] + c3], u[0] == c4
} /. {c1 -> 1, c2 -> 1, c3 -> 1, c4 -> 1},
u,
{t, 0, 30}
]


For other parameter values the ODE might become less well behaved. If for your set of parameters NDSolve gives warnings, let us know what the values of the given parameters are (or what the values of your original parameters and the function definitions you use are).

-