Kernel: Python 2 (SageMath)
CS 510
Midterm Project
Sean Paradiso
Full Attractor Class
In [1]:
Proper 1D plots of x, y, and z vs. time t as the horizontal axis
In [2]:
Proper 2D plots of x-y, y-z, z-x planes
In [3]:
Proper 3D plot of x-y-z
In [4]:
Explorative Questions to Explore Sensitivity to Increment, Timestep, and Initial Condition:
1. How does the plotted solution depend on your choice of time step size, and your choice of increment? Do you see an improvement in precision from using the higher-order integration methods?
Let's explore this question by altering the number of points being passed in to the Attractor class which will in turn change the time increment dt. We will first pursue the plotted solution of of the fourth order Runge-Kutta method using 500 points, then the default 1000 points, and finally we will explore 2000 points.
In [5]:
In [6]:
In [7]:
The plotted solution greatly depends on the choice of step size in terms of the 'fluidity', if you will, of the the plot. A very large change can clearly be seen from the 500 points case to the 2000 points. With the intial 500 sample points we get a set of heavily right skewed plots for each x, y, and z case versus time as well as very geometric and sharp edged set of displays when comparing x(t) to y(t) and z(t) in all 2D cases and the same holds true for the one 3D case. When we compare that to the 1000 points sample we can clearly see a much greater spread amongst the x, y, z vs time plots as well as a much smoother and full, almost elliptical, plot for the 2D and 3D plots (bearing in mind that there is still visual evidence, eg. sharp edges, of areas of improvement. This leads us to our final 2000 points sample wherein we continue our trend of smoothing and accuracy.
As for the second portion of this question, i.e. "Do you see an improvement in precision from using the higher-order integration methods?", we will use the largest disparity of any substance at our disposal; the second order and fourth order methods of rk2 and rk4 respectively. To really hone in on the precision aspect we will explore this question with 2000 sample points.
In [8]:
In [9]:
Through basic visual inspection we can immediately see improvement in precision from using the higher-order integration method. The fourth order Runge-Kutta is much more uniform and tightly knit as well as being significantly smoother. Thusly leading us to the aforementioned answer of increased precision with higher-order integration methods.
2. How does the solution depend upon the initial conditions [x0, y0, z0]? How small a change can you make while still reproducing roughly the same dynamical curves?
To explore these questions we will use 2000 sample points on the highest order integration method to keep consistency and make it simpler to draw conclusions. Our first change will be small, we'll go from [1, 0, 1] to [10, 5, 10] and review the resulting plots.
In [10]:
In [11]:
As we can see, there was very minimal change. With this knowledge we can continue in a coarser fashion. We will now move from [10, 5, 10] to [1000, 500, 1000] and see what happens.
In [12]:
Again, we see little to no visible change. For the sake of completeness let's try altering the values in the opposite direction. Next up, [-100, -50, -100].
In [13]:
This visual information leads us to the fact that the symmetry of the method negates whether or not the values are negative or positive.
To answer the question at hand, the solution does not heavily depend on the initial conditions. Almost any change produced the same, or similar, dynamical curves.
Functionality: displaying values with no error messages
In [14]:
array([ 0.92 , 0.216 , 0.97866667])
In [15]:
array([ 0.93184 , 0.20657792, 0.97972366])
In [16]:
array([ 0.93130186, 0.20741988, 0.97968745])
In [17]:
Below are some random test cases just to play around with the program
In [18]:
In [19]:
In [20]:
In [21]:
In [22]:
In [23]:
In [24]:
In [25]:
In [26]:
In [27]:
In [28]:
In [29]:
In [30]:
In [31]:
In [32]:
In [33]:
In [34]: