Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions ipython/CoupledSpringMassSystem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"with open('two_springs.dat', 'w') as f:\n",
" # Print & save the solution.\n",
" for t1, w1 in zip(t, wsol):\n",
" print >> f, t1, w1[0], w1[1], w1[2], w1[3]"
" print(t1, w1[0], w1[1], w1[2], w1[3], file=f)"
],
"language": "python",
"metadata": {},
Expand All @@ -183,7 +183,7 @@
"# Plot the solution that was generated\n",
"\n",
"from numpy import loadtxt\n",
"from pylab import figure, plot, xlabel, grid, hold, legend, title, savefig\n",
"from pylab import figure, plot, xlabel, grid, legend, title, savefig\n",
"from matplotlib.font_manager import FontProperties\n",
"\n",
"t, x1, xy, x2, y2 = loadtxt('two_springs.dat', unpack=True)\n",
Expand All @@ -192,7 +192,6 @@
"\n",
"xlabel('t')\n",
"grid(True)\n",
"hold(True)\n",
"lw = 1\n",
"\n",
"plot(t, x1, 'b', linewidth=lw)\n",
Expand Down Expand Up @@ -220,4 +219,4 @@
"metadata": {}
}
]
}
}