1. This will be familiar to those who attend class. Consider the oscillator described by the ordinary differential equation (ODE) below for the quantity x(t). This type of oscillator has wide applicability to topics such as blood flow in the aorta and oscillations in electronic devices. x + µx (x² − x² ) + 2x = 0. - Here, x is the dependent variable and the time t is the independent variable. The quantities μ, xo and w are all constants and the dot notation refers to derivatives with respect to time. Note that if μ = 0 you get the differential equation for a simple harmonic oscillator, familiar to you from introductory physics. a) Solve this equation by finding x(t) using the techniques discussed in class and for the initial conditions x = 0.5 and x = 0. Use μ = 0.1, x2: = 1 and w 1 for the constants. Construct 2 plots in a single "canvas" (using the subplot method we have seen). The first plot is displacement x versus time t and the second is i versus x (along the horizontal axis). Make the time span long enough so that the initial behavior of the oscillator disappears and its steady state becomes apparent. Maybe something like [0,200]. The first subplot plot should have "Time" labeled along the x-axis and "Position" along the y-axis. This first subplot should be titled "Position versus Time". Finally, the plot will look a bit better if you make its width larger than its height since you want a long time span. Perhaps plt.figure(figsize=(10, 6)) will suffice at the appropriate spot in your code. The second subplot should be labeled "Position" along the x-axis and "Velocity" along the y-axis. This type of useful plot is called a "phase space" plot. Title it, what else, "Phase Space". This plot should have the same "aspect ratio" as the first. 1 b) Repeat making the 2 plots but alter μ to μ = -0.02. Leave the other constants unchanged. Label the new subplot pair as above. Note the difference in the shape of both these plots. You should see that the plots start with the same initial displacement, namely 0.5. Do you agree? Actually look at the plots and do not just merely burp out "yes."

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.5: Case Studies
Problem 15E
Question

Please show the code for this assignment using python in a jupyter notebook. I am stuck

1. This will be familiar to those who attend class. Consider the oscillator described
by the ordinary differential equation (ODE) below for the quantity x(t). This type of
oscillator has wide applicability to topics such as blood flow in the aorta and oscillations
in electronic devices.
x + µx (x² − x² ) + 2x = 0.
-
Here, x is the dependent variable and the time t is the independent variable. The
quantities μ, xo and w are all constants and the dot notation refers to derivatives with
respect to time. Note that if μ = 0 you get the differential equation for a simple harmonic
oscillator, familiar to you from introductory physics.
a) Solve this equation by finding x(t) using the techniques discussed in class and for the
initial conditions x = 0.5 and x = 0. Use μ = 0.1, x2: = 1 and w 1 for the constants.
Construct 2 plots in a single "canvas" (using the subplot method we have seen). The first
plot is displacement x versus time t and the second is i versus x (along the horizontal
axis). Make the time span long enough so that the initial behavior of the oscillator
disappears and its steady state becomes apparent. Maybe something like [0,200]. The
first subplot plot should have "Time" labeled along the x-axis and "Position" along the
y-axis. This first subplot should be titled "Position versus Time". Finally, the plot will
look a bit better if you make its width larger than its height since you want a long time
span. Perhaps plt.figure(figsize=(10, 6)) will suffice at the appropriate spot in your code.
The second subplot should be labeled "Position" along the x-axis and "Velocity" along
the y-axis. This type of useful plot is called a "phase space" plot. Title it, what else,
"Phase Space". This plot should have the same "aspect ratio" as the first.
1
b) Repeat making the 2 plots but alter μ to μ = -0.02. Leave the other constants
unchanged. Label the new subplot pair as above. Note the difference in the shape of
both these plots. You should see that the plots start with the same initial displacement,
namely 0.5. Do you agree? Actually look at the plots and do not just merely burp out
"yes."
Transcribed Image Text:1. This will be familiar to those who attend class. Consider the oscillator described by the ordinary differential equation (ODE) below for the quantity x(t). This type of oscillator has wide applicability to topics such as blood flow in the aorta and oscillations in electronic devices. x + µx (x² − x² ) + 2x = 0. - Here, x is the dependent variable and the time t is the independent variable. The quantities μ, xo and w are all constants and the dot notation refers to derivatives with respect to time. Note that if μ = 0 you get the differential equation for a simple harmonic oscillator, familiar to you from introductory physics. a) Solve this equation by finding x(t) using the techniques discussed in class and for the initial conditions x = 0.5 and x = 0. Use μ = 0.1, x2: = 1 and w 1 for the constants. Construct 2 plots in a single "canvas" (using the subplot method we have seen). The first plot is displacement x versus time t and the second is i versus x (along the horizontal axis). Make the time span long enough so that the initial behavior of the oscillator disappears and its steady state becomes apparent. Maybe something like [0,200]. The first subplot plot should have "Time" labeled along the x-axis and "Position" along the y-axis. This first subplot should be titled "Position versus Time". Finally, the plot will look a bit better if you make its width larger than its height since you want a long time span. Perhaps plt.figure(figsize=(10, 6)) will suffice at the appropriate spot in your code. The second subplot should be labeled "Position" along the x-axis and "Velocity" along the y-axis. This type of useful plot is called a "phase space" plot. Title it, what else, "Phase Space". This plot should have the same "aspect ratio" as the first. 1 b) Repeat making the 2 plots but alter μ to μ = -0.02. Leave the other constants unchanged. Label the new subplot pair as above. Note the difference in the shape of both these plots. You should see that the plots start with the same initial displacement, namely 0.5. Do you agree? Actually look at the plots and do not just merely burp out "yes."
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage