Question: Please answer in python a) The linear second-order ODE describing the motion of a harmonic oscillator is given by dx dt2 -0-x. while equations of

Please answer in python
a) The linear second-order ODE describing the motion of a harmonic oscillator is given by dx dt2 -0-x. while equations of motion for anharmonic oscillators can be much more diverse and complicated. Let's consider, for example, the following form: dx dt2 -0-X3. Instead of plotting x against t, one can plot dx/dt against x, i.e., the velocity of the oscillator against its position. Such a plot is called a phase space plot. Take a = 1 and initial conditions x = 1 and dx/dt = 0 to solve both equations presented above. t is in the range from t = 0 tot = 50. Make the phase space plots for both cases, and put them in one figure. Again put your vector function f in classes. b) The van der Pol oscillator, which appears in electronic circuits and in laser physics, is described by the equation d x dx - u(1 x2) +0x = 0. dt dt2 Solve this equation from t = 0 tot = 20 and hence make a phase space plot for the van der Pol oscillator with = 1, u = 0.2, and initial conditions x = 1 and dx/dt = 0. Do the same also for u = 0.8 and u = 2.5 (still with w= 1). Do not put everything on one plot; you should produce three different plots in this part. As usual, put your vector function f representing the righthand side of ODE's in a class. a) The linear second-order ODE describing the motion of a harmonic oscillator is given by dx dt2 -0-x. while equations of motion for anharmonic oscillators can be much more diverse and complicated. Let's consider, for example, the following form: dx dt2 -0-X3. Instead of plotting x against t, one can plot dx/dt against x, i.e., the velocity of the oscillator against its position. Such a plot is called a phase space plot. Take a = 1 and initial conditions x = 1 and dx/dt = 0 to solve both equations presented above. t is in the range from t = 0 tot = 50. Make the phase space plots for both cases, and put them in one figure. Again put your vector function f in classes. b) The van der Pol oscillator, which appears in electronic circuits and in laser physics, is described by the equation d x dx - u(1 x2) +0x = 0. dt dt2 Solve this equation from t = 0 tot = 20 and hence make a phase space plot for the van der Pol oscillator with = 1, u = 0.2, and initial conditions x = 1 and dx/dt = 0. Do the same also for u = 0.8 and u = 2.5 (still with w= 1). Do not put everything on one plot; you should produce three different plots in this part. As usual, put your vector function f representing the righthand side of ODE's in a class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
