Closed dsrivallabha closed 10 years ago
A few comments:
%matplotlib inline
early on or the plotting calls will make it freeze.Hello Sir, thank you for the comments. Here is what I think.
Hi @dsrivallabha ,
The version of IPython in the Ubuntu 12.04 repositories is pretty old. You can update it by installing pip
and then upgrading to the latest version.
sudo apt-get install python-pip
sudo pip install --upgrade pip
sudo pip install --upgrade ipython[notebook]
time = numpy.linspace(0.0, T, N)
to get the time vector, which reduces the size of the state vector.Hi @gforsyth,
I tried doing what you suggested. I was able to install and upgrade pip. I was unable to upgrade ipython notebook. It required a gcc compiler that is not currently installed. If I try to open ipython notebook now, it says tornado >= 3.1.0 is required which is not installed. So, ipythone notebook doesn't work now and I am trying to go back to the earlier state.
Sorry about that! You can do
sudo apt-get install build-essential
And that will fix the compiler errors.
Even the above command did not work. I installed latest version of Tornado, meddled with pyzmq and finally got the notebook working. The process of installation on Ubuntu seems to be slightly complicated. Anyway, will follow up the earlier comments by Prof. Ian Hawke.
Added changes 1 & 2 suggested by Prof. Ian Hawke. I am unable to view any widgets suggested in 3 by Prof Hawke. I may not incorporate them. This will be the final commit for this assignment unless there are any changes to logic. Please let me know your thoughts.
As a logical set of exercises it makes sense to me.
Some minor coding points;
O/w, +1.
Hello Sir, Made the following changes you suggested.
Looks good to me. Any comments from eg @labarba or @gforsyth ?
Looks good. I have one suggestion.
Consider changing the phase plot to add these options:
plt.plot(x_euler, y_euler, '-->', markevery=5, label = 'phase plot')
It just adds arrow pointers so that it's easier to tell where things begin and end.
@dsrivallabha That is super! Do add a note at the end with your authorship: the copyright of your writings are yours, of course, but we encourage you to liberate your work with a Creative Commons attribution license (CC-BY 4.0). If you agree, then, you should add your name and the CC-BY note somewhere. Nice contribution to the Assignment Bank!
Thank you @IanHawke @labarba @gforsyth for your valuable suggestions.
This new assignment in ODEs demonstrates use of Python to solve Predator Prey Model, also known as Lotka Volterra Equation.