Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.4K Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

NDSolve Error

I've been trying this in university:

ε = 0.005

p = 2

deq1 = x'[t] == (x[t] + y[t] - q*(x[t]^2) - x[t]*y[t])

deq2 = y'[t] == -y[t] + z[t] - x[t]*y[t]

deq3 = z'[t] ==   (x[t] - z[t])/p

tmin = 0; tmax = 20;

sol1 = NDSolve[{deq1, deq2, deq3, x[0] ==  8, y[0] ==   6, 
   z[0] ==   23}, {x, y, z}, {t, tmin, tmax}]

and it keeps giving me an error of

NDSolve::deqn: Equation or list of equations expected instead of True in the first
argument {(x'[t]==x[t]-q x[t]^2+y[t]-x[t] y[t],(y'[t]==-y[t]-x[t] y[t]+z[t],
(z'[t]==1/2 (x[t]-z[t]),True,True,True}.

I mean, I know what it says, but I have no idea how to fix it...Isn't this the way to write NDSolve? It's the first time I get something like that Please help

3 Replies

That error indicates that x[0] was probably earlier set to 8 (that is one equal sign instead of two) and similar for the other initializations. In such cases, using Clear can help.

POSTED BY: Daniel Lichtblau
Posted 5 years ago

When I run your code on a fresh kernel I get an error message "NDSolve::ndnum: Encountered non-numerical value for a derivative at t == 0.`.". This is caused by having no numerical value assigned to q.

If I run your code again setting q=2 I obtain a solution for x, y, z given as InterpolatingFunctions.

POSTED BY: Michael Helmle

I imagined something like that must had happened. The q is simply implied to be in a specific range of numbers. I'll just assume a value for q. Thank you for your time.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard