solving ordinary differential equations step equations forward in time for in range(n_t) [ + [ndt*( / )*( ( [ ] ( [ ] ( [ ]) [ + [ndt* [ + return uvt the -th order runge-kutta method the rk method just evaluates the righthand side of the ode system /vm for known values of uvand tso the method is very simple to use regardless of how the functions uand vare chosen illustration of linear damping we consider an engineering system with linear springs ud kxand viscous damperwhere the damping force is proportional to bu for some constant this choice may model the vertical spring system in car (but engineers often like to illustrate such system by horizontal moving mass like the one depicted in fig we may choose simple values for the constants to illustrate basic effects of damping (and later excitationschoosing the oscillations to be the simple td cos function in the undamped casewe may set : the following function implements this casedef linear_damping() lambda vb* lambda uk* lambda u_ v_ *pi dt / uvt eulercromer( =fs=sf=fm=mt=tu_ =u_ v_ =v_ dt=dtplot_u(utthe plot_u function is collection of plot statements for plotting /or part of it figure shows the effect of the bu termwe have oscillations with (an approximateperiod as expectedbut the amplitude is efficiently damped remark about working with scaled problem instead of setting : and as fairly "unlikelyphysical valuesit would be better to scale the equation mu cbu cku this means