Message Boards Message Boards

NDSolve a system of differential equations with initial conditions?

I don know what is wrong with my initial conditions in the following problem

sol = NDSolve[{x'''[t] == y'[t] x[t], 
   y''[t] == -(1/(x[t]^2 + y[t]^2)), x[0] == 1, x'''[0] == 0, 
   y'[0] == 0, y''[0] == 0}, {x, y}, {t, 0, 100}]

Returns 2 errors:

NDSolve::icordinit: The initial values for all the dependent variables are not explicitly specified. NDSolve will attempt to find consistent initial conditions for all the variables.

and

NDSolve::ndnco: The number of constraints (4) (initial conditions) is not equal to the total differential order of the system plus the number of discrete variables (5).

UPDATE

Sorry... I had made up the above DE to test how NDSolve works ,but use a bad example. Here is another .. please comment

NDSolve[{x'''[t] == 
   x[t] Derivative[1][y][t], (y^\[Prime]\[Prime])[t] == -(1/(
    x[t]^2 + y[t]^2)), x[0] == 1, x'''[0] == 0, y[0] == 1/8, 
  Derivative[1][y][0] == 0, (y^\[Prime]\[Prime])[0] == 1/2}, {x, 
  y}, {t, 0, 1}]

The errors now are :

*NDSolve::icordinit: The initial values for all the dependent variables are not explicitly specified. NDSolve will attempt to find consistent initial conditions for all the variables. NDSolve::icres: NDSolve has computed initial values that give a zero residual for the differential system, but some components are different from those specified. If you need them to be satisfied, giving explicit initial values to all dependent variables is recommended.*

POSTED BY: Jose Calderon
6 Replies
Posted 1 year ago
POSTED BY: Coding Geeks

The code

ClearAll["Global`*"]
\[Nu] = 5*10^-5;
k = 2*\[Pi]*\[Nu];
sol = NDSolve[{\[Nu]*u''[y] + k*(y)^2*Abs[u'[y]]*u''[y] == 0, 
   u[0] == 0, u'[0.999553801] == 0}, u, {y, 0, 0.999553801}]

works fine for me. It gives the null function.

POSTED BY: Gianluca Gorni

Jose,

2 problems with your update. You have a typo in 2 places: y^'' should just be y''

Also, you should not specify initial conditions on x''' because it is determined from an equation. Same for y''. Both are not valid initial conditions. (see @Gianluca Gorni post above)

This works: (as would any combination of initial conditions that does not involve x''' nor y'')

NDSolve[{x'''[t] == x[t] Derivative[1][y][t], 
  y''[t] == -(1/(x[t]^2 + y[t]^2)), x[0] == 1, x''[0] == 0, 
  y[0] == 1/8, Derivative[1][y][0] == 0, y'[0] == 1/2}, {x, y}, {t, 0,
   1}]

Regards

POSTED BY: Neil Singer
POSTED BY: Neil Singer

Thank you.. I made up the DE problem . I am looking to test how NDsolve does works. I have made another correction but still don't know why I am no getting anywhere.

POSTED BY: Jose Calderon
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract