Keywords: Damped Oscillation2.svg Damped oscillaions given by the equation <math>x t e at \left \cos bt - \frac a b \sin bt \right</math> Created using python with numpy and matplotlib toolkits cot Source code <syntaxhighlight lang python > from numpy import from matplotlib pyplot import from mpl_toolkits axisartist import time linspace 0 10 fun lambda a b t exp a t cos b t - a/b sin b t fig figure figsize 5 5 ax1 Subplot fig 111 ax1 axis right set_visible False ax1 axis left set_axisline_style - > ax1 axis top set_visible False ax1 axis bottom set_visible False ax1 axis x ax1 new_floating_axis 0 0 ax1 axis x set_axisline_style - > ax1 plot time fun - 25 1 time lw 1 5 label 'a -0 25 b 1' ax1 plot time fun - 5 1 time lw 1 5 label 'a -0 5 b 1' ax1 plot time fun - 5 5 time lw 1 5 label 'a -0 5 b 0 5' ax1 grid True ax1 text 10 05 r' t ' ax1 set_ylabel r' x t e at \left \cos bt - \frac a b \sin bt \right ' ax1 set_ylim - 5 1 25 ax1 set_yticks arange -0 4 1 25 2 ylabels for i in arange -0 4 1 25 2 if i 0 ylabels append ylabels 1f i else ylabels append ylabels ax1 set_yticklabels ylabels ax1 minorticks_on ax1 legend frameon False fig add_subplot ax1 fig savefig test png bbox_inches tight pad_inches 15 </syntaxhighlight> cob own Krishnavedala 2011-06-14 File Damped svg validSVG Cc-zero Control engineering Control theory Images with Python source code Created with Matplotlib |