Group Abstract Group Abstract

Message Boards Message Boards

NDSolve a system of differential equations with initial conditions?

POSTED BY: Jose Calderon
6 Replies
Posted 3 years ago
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}] 

I cant understand my error it says NDSolve::ndode: The equations {0[0.999554]==0} are not differential equations or initial conditions in the dependent variables {u}.

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

Jose,

Gianluca is correct. Your initial conditions should look something like this:

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

Regards,

Neil

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

The condition x'''[0] == 0 is superfluous, because it is a consequence of the first equation and of y'[0] == 0. The condition y''[0] == 0 is not compatible with the second equation.

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