Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Harmonic motion. An unforced, damped oscillator is modeled by the equation $$ m y^{\prime \prime}+c y^{\prime}+k y=0, $$ where \(m\) is the mass, \(c\) is the damping constant, and \(k\) is the spring constant. Write the equation as a system of first order ODEs and create a function ODE file that allows the passing of parameters \(m, c\), and \(k\). In each of the following cases compute the solution with initial conditions \(y(0)=1\), and \(y^{\prime}(0)=0\) over the interval \([0,20]\). Prepare both a plot of \(y\) versus \(t\) and a phase plane plot of \(y^{\prime}\) versus \(y\). a) (No damping) \(m=1, c=0\), and \(k=16\). b) (Under damping) \(m=1, c=2\), and \(k=16\). c) (Critical damping) \(m=1, c=8\), and \(k=16\). d) (Over damping) \(m=1, c=10\), and \(k=16\).

Short Answer

Expert verified
Convert the second order ODE to a system of first order ODEs, solve numerically, and plot the results.

Step by step solution

01

Convert Second Order ODE to First Order System

The equation \(m y'' + c y' + k y = 0\) is a second order ordinary differential equation (ODE). We can convert it to a system of first-order ODEs by introducing two new variables. Let \(y_1 = y\) and \(y_2 = y'\). This gives us:1. \(y_1' = y_2\).2. \(y_2' = -\frac{c}{m}y_2 - \frac{k}{m}y_1\).This system can now be solved numerically using standard techniques for first-order ODEs.
02

Set Up the ODE File

Create a function that represents this system of ODEs. Typically, this function will take in the current time \( t \), the current values of \( y_1 \) and \( y_2 \), and the parameters \( m, c, \) and \( k \) to return the derivatives:```pythondef damped_oscillator(t, y, m, c, k): y1, y2 = y # unpack the current values dydt = [y2, -c/m * y2 - k/m * y1] return dydt```This function can then be used with a numerical solver that requires functions of this format.
03

Define Parameters and Initial Conditions

For each case, define the parameters \(m, c, k\) and the initial conditions \(y(0) = 1\) and \(y'(0) = 0\). This gives \((y_1(0), y_2(0)) = (1, 0)\) as the initial condition.
04

Numerical Solution Using ODE Solver

Use a numerical ODE solver to compute the solution over the interval \([0, 20]\). In Python, for instance, you could use `scipy.integrate.solve_ivp`:```pythonfrom scipy.integrate import solve_ivp# Define time span and initial conditionstime_span = (0, 20)initial_conditions = [1, 0]# Solve for each casesol_no_damping = solve_ivp(damped_oscillator, time_span, initial_conditions, args=(1, 0, 16))sol_under_damping = solve_ivp(damped_oscillator, time_span, initial_conditions, args=(1, 2, 16))sol_critical_damping = solve_ivp(damped_oscillator, time_span, initial_conditions, args=(1, 8, 16))sol_over_damping = solve_ivp(damped_oscillator, time_span, initial_conditions, args=(1, 10, 16))```
05

Plot the Results

Plot \( y \) vs. \( t \) and the phase plane \( y' \) vs. \( y \) for each case:```pythonimport matplotlib.pyplot as plt# Example for no damping caseplt.figure(figsize=(12, 5))# y versus tplt.subplot(1, 2, 1)plt.plot(sol_no_damping.t, sol_no_damping.y[0], label='No Damping')plt.xlabel('Time t')plt.ylabel('Displacement y')plt.title('Displacement vs Time')plt.legend()# Phase Plane Plotplt.subplot(1, 2, 2)plt.plot(sol_no_damping.y[0], sol_no_damping.y[1], label='No Damping')plt.xlabel('Displacement y')plt.ylabel('Velocity y extquotesingle')plt.title('Phase Plane')plt.legend()plt.tight_layout()plt.show()```Repeat similarly for the other conditions.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

Key Concepts

These are the key concepts you need to understand to accurately answer the question.

Damped Oscillator
In physics, a damped oscillator is a system where an oscillating object experiences resistance that reduces its amplitude over time. This resistance, or damping, can come from friction or other forces. The mathematical model for a damped oscillator can be represented as a second-order differential equation:
\[ m y'' + c y' + k y = 0 \] Here,
  • \( m \): the mass of the object
  • \( c \): the damping constant
  • \( k \): the spring constant
Damping affects how quickly the oscillations die down:
  • No damping: The system oscillates indefinitely.
  • Under damping: Oscillations gradually reduce.
  • Critical damping: The system returns to equilibrium without oscillating.
  • Over damping: The system returns to equilibrium slowly, without oscillating.
These distinctions are crucial in mechanical and electrical engineering, as different applications require different damping properties. Analyzing these systems helps in optimizing the performance of many devices.
First Order ODEs
Differential equations that involve first derivatives are called first order ordinary differential equations (ODEs). They simplify the analysis of many natural systems. To convert a second order ODE into a system of first order ODEs, we introduce new variables to reduce each derivative order.

For the damped oscillator, we set:
  • \( y_1 = y \)
  • \( y_2 = y' \)
Thus, the original second order ODE becomes:
  • \( y_1' = y_2 \)
  • \( y_2' = -\frac{c}{m} y_2 - \frac{k}{m} y_1 \)
This transformation is powerful because standard numerical solvers are generally designed to handle first order ODEs. It allows us to apply established methods to efficiently find solutions to problems that initially appear complex.
Numerical Solution
In cases where analytical solutions are difficult or impossible to compute, numerical methods are applied. These methods approximate the solutions of differential equations at discrete points, making them extremely useful for practical scenarios.

Using numerical solvers like `scipy.integrate.solve_ivp`, we can solve the system of first order ODEs for the damped oscillator model. This function integrates the ODEs across a given interval for specified initial conditions and parameters. It allows us to simulate the system's behavior over time.
  • This involves defining the time span, initial conditions, and model parameters.
  • The solver computes the state of the system at successive time points, providing a detailed description of how the system evolves.
By plotting these results, we can visualize the system's dynamics, such as displacement over time and the relationship between displacement and velocity (phase plane plots). This visualization aids in interpreting the behavior under different damping conditions.
Initial Conditions
Initial conditions specify the starting point of a system in terms of position and velocity. In the context of differential equations, they are crucial for finding unique solutions. Initial conditions dictate how the system behaves right from the start.

For the damped oscillator problem, the initial conditions were set as:
  • \( y(0) = 1 \)
  • \( y'(0) = 0 \)
These conditions imply that the oscillation begins at its maximum amplitude while initially at rest. This setup helps us observe the effects of various damping conditions on the system's dynamics. Initial conditions must be carefully considered for simulations to accurately reflect the physical scenario being modeled. They are foundational for predictive modeling and analyzing system behavior accurately.

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

In Exercises \(9-12\), write a function ODE file for the system. Solve the initial value problem using ode45. Provide plots of \(x_{1}\) versus \(t, x_{2}\) versus \(t\), and \(x_{2}\) versus \(x_{1}\) on the time interval provided. See Exercises \(1-6\) in Chapter 7 for a nice method to arrange these plots. \(x_{1}{ }^{\prime}=x_{2}\) and \(x_{2}^{\prime}=\left(1-x_{1}^{2}\right) x_{2}-x_{1}\), with \(x_{1}(0)=0\) and \(x_{2}(0)=4\) on \([0,10]\).

\(x^{\prime}+x+x^{3}=\cos ^{2} t\), with \(x(0)=-3,-2, \ldots, 3\).

Separate variables and find an explicit solution of \(x^{\prime}=t /(1+x), x(0)=1\). a) Use ode45 to find the numerical solution of the initial value problem on the interval \([0,3]\). Store the solution in the variables \(t\) and \(x_{-}\)ode45. b) Use the explicit solution to find exact solution values at each point in the vector \(t\) obtained in part a). Store the results in the variable \(x_{-}\)exact. Compare the solutions graphically with plot \(\left(t\right.\), \(x_{-}\)exact, \(t\), x_ode45, 'r. '). Obtain a printout with a legend. c) For a finer graphical image of the error plot \(\mathrm{x}_{-}\)exact - \(\mathrm{x}_{-}\)ode45 versus \(\mathrm{t}\) in a new figure. Pay special attention to the dimensions on the \(y\)-axis.

\(y^{\prime}+4 y=t^{2}\), with \(y(0)=-9,-8,-7,-1,1,7,8,9\).

\(x_{1}{ }^{\prime}=\left(x_{2}+x_{1} / 5\right)\left(1-x_{1}^{2}\right)\) and \(x_{2}^{\prime}=-x_{1}\left(1-x_{2}^{2}\right)\), with \(x_{1}(0)=0.8\) and \(x_{2}(0)=0\) on \([0,30]\).

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free