why power series plot is not matching with ode

5 views (last 30 days)
shiv gaur
shiv gaur on 22 Feb 2022
Commented: Walter Roberson on 24 Feb 2022
for i=1:10
plot(t,x) not matching
Torsten on 22 Feb 2022
According to
the coefficients of the power series for x(t), y(t) and z(t) of the Lorenz system are much more difficult than

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 22 Feb 2022
syms x
f = log(x+1)
f = 
xtay = taylor(f, x, 0, 'order', 10)
xtay = 
subplot(2,1,1); fplot(f, [-30 30])
subplot(2,1,2); fplot(xtay, [-30 30])
Just because you take a truncated taylor series doesn't mean that the truncated taylor series is at all accurate as you get away from the expansion point.
Walter Roberson
Walter Roberson on 23 Feb 2022
Also, you are plotting only 20 points; you cannot possibly see 50 changes of direction in only 20 points. You would need at least 101 points to see 50 changes of direction.
If you try to extend numerically to higher degrees, higher maximum i, then i = 15 is as high as your code can go before some of the coefficients overflow to infinity.
If you switch to symbolic computation and ask to go higher degree.. then it takes a long time. And you tend to get points evaluated to be on the order of 10^27000.
At this point you have several possibilities to consider:
  • that if you evaluated to a "high enough" degree symbolically, that you just might get a decent interpolation over t = 1 to t = 20
  • that, because the minimum degree for replicating the plot is at least 50, and you are evaluating out to t = 20, you are going to have constant * 20^50 ~~ 10^65 and you are hoping for final results in the order of +/- 20... you are going to need to evaluate symbolically to extra digits or else the values you want will disappear as noise
  • that since the system appears to have an infinite number of changes of direction (we can mentally interpolate that there will be many more peaks at increasing x), that any finite polynomial approximation might perhaps be too badly conditioned to be useful, calculations that might work in theory but are more like balancing on the edge of a pin numerically
  • your implementation for calculating the coefficients might be wrong. But as I have taken the equations and implemented them in a different software package, I know that even if you got a detail wrong, that the proper plot looks a lot like the first plot, and an order 10 series expansion for x looks a lot like what you plotted, so even if you got a detail wrong, the exact same challenges would be sure to happen even if you had the details perfect.

Sign in to comment.

shiv gaur
shiv gaur on 23 Feb 2022
dear sir this is the paper which is solve by power series method
Walter Roberson
Walter Roberson on 24 Feb 2022
I have been working for about 18 hours. I need rest.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by