Hello everyone.(adsbygoogle = window.adsbygoogle || []).push({});

I have a second order ODE, which I reduced to two first order ODEs, and solved with ode45. Now I want to evaluate the solution and the derivative at certain points (specifically, I want to plot the Poincare section).

So, what I did is this:

Where:Code (Text):>> sol=ode45(@...);

>> xint=a:b;

>> [Sxint, Spxint]=deval(sol, xint);

>> A=[Sxint, Spxint];

>> plot(Sxint, Spxint,'o')

xintis the points at which I want to evaluate the solution.

Sxintis the value of the solution at the points xint.

Spxintis the value of the derivative at those points.

But this is clearly wrong. I know the solution should be periodic, but I get something random. I think it's the plotting I'm doing incorrectly. Any help appreciated.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab:Evaluating ODE at Points

Loading...

Similar Threads for Matlab Evaluating Points | Date |
---|---|

MATLAB MATLAB: forces acting on an object | Apr 6, 2018 |

MATLAB - Reached the maximum number of function evaluations | Oct 19, 2011 |

Evaluating polynomials in Matlab | Jun 12, 2008 |

MATLAB numerical evaluation | Feb 19, 2008 |

MATLAB numerical evaluation doubt | Feb 19, 2008 |

**Physics Forums - The Fusion of Science and Community**