Skip to main content
1-Visitor
January 15, 2019
Solved

Plotting failed. Replace complex values and NaNs by real numbers.

  • January 15, 2019
  • 1 reply
  • 5573 views

Hi, I'm fairly new to Mathcad. Trying to plot the solution to a differential equation but I can't seem to get it working. I've attached the necessary files.

 

Thanks!e.PNG

 

 

 

Best answer by Werner_E

You used a wrong syntax for odesolve!

B.PNG

1 reply

Werner_E25-Diamond IAnswer
25-Diamond I
January 15, 2019

You used a wrong syntax for odesolve!

B.PNG

1-Visitor
January 15, 2019

Hi,

 

Sorry to bother you again, whenever I raise x(t) to the 2nd power, so: x(t)^2 the odesolver breaks. It gives me: Unkown error.

 

Any idea how to fix this?
heres the code, I changed x to v.

25-Diamond I
January 15, 2019

As v1 and v2 are independent from each other I would rather use a separate solve block for each of them. 

But it should work the way you has done, too.

The problem is the equation for v1. when t increases, v1(t) decreases dramatically and Primes algorithm would fails because it does not converge,

You may look for the equation if its correct.

Only solution so far seems to be to set Tf to a lower value. Tf=2.65 seems to be the largest value possible.

B1.png