Using Python write a 4th-order Runge-Kutta method to numerically solve the following force damped harmonic oscillator equation x = −2(w₁x - w²2x + Fmxc with initial conditions x(0)= 1 and r(0)= 0. In addition, use ( = 1/10, wo = 10 and w = wo for plot 1 and w = 2wn for plot 2. Note, you will be solving the equation twice, one for a driving force equal to sin wot and the second with a driving force equal to sin 2wot. h = 0.1 and 0 ≤t≤40 Check for step size convergence and once achieved, plot both solutions.
Using Python write a 4th-order Runge-Kutta method to numerically solve the following force damped harmonic oscillator equation x = −2(w₁x - w²2x + Fmxc with initial conditions x(0)= 1 and r(0)= 0. In addition, use ( = 1/10, wo = 10 and w = wo for plot 1 and w = 2wn for plot 2. Note, you will be solving the equation twice, one for a driving force equal to sin wot and the second with a driving force equal to sin 2wot. h = 0.1 and 0 ≤t≤40 Check for step size convergence and once achieved, plot both solutions.
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.7: Do While Loops
Problem 6E: (Numerical analysis) Here’s a challenging problem for those who know a little calculus. The...
Related questions
Question

Transcribed Image Text:Using Python write a 4th-order Runge-Kutta method to numerically solve the following force
damped harmonic oscillator equation
x = −2(w₁x - w²2x + Fmxc
with initial conditions x(0)= 1 and r(0)= 0. In addition, use ( = 1/10, wo = 10
and w = wo for plot 1 and w = 2wn for plot 2. Note, you will be solving the equation twice,
one for a driving force equal to sin wot and the second with a driving force equal to sin 2wot.
h = 0.1 and 0 ≤t≤40
Check for step size convergence and once achieved, plot both solutions.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Recommended textbooks for you

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr

Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr

Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT