A mass m is held by two perpendicular identical springs in space in the x-y plane and is dropped from a height zo under the influence of gravity (let's call this the "dropped 2D harmonic oscillator"). The mass moves in a potential 1 U (x, y, z) = -k(x² + y²) + mgz 2 and the motion stops when the mass hits the ground at z = 0. (You don't need U(x, y, z) for solving the problem and it is only provided for the exact physics context.) The trajectory of the mass, i.e, its curve in space, r(t) = (x(t), y(t), z(t)) is x(t) = A cos(wt) y(t) = B cos(wt + p) 1 z(t) = -=- gt² +20 where the amplitudes A, B and the phase difference are determined by the initial conditions, and the frequency is w = √k/m. 9.81, write a program that Given A = 1, B = 2, p= π/3, w = 0.5, and g = 1, reads the initial drop height zo from user input;

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

pls python help

**Title: Dropped 2D Harmonic Oscillator**

A mass \( m \) is held by two perpendicular identical springs in space in the x-y plane and is dropped from a height \( z_0 \) under the influence of gravity (let's call this the "dropped 2D harmonic oscillator"). The mass moves in a potential:

\[ U(x, y, z) = \frac{1}{2} k (x^2 + y^2) + mgz \]

where \( k \) is the spring constant and \( g \) is the acceleration due to gravity.

The motion stops when the mass hits the ground at \( z = 0 \). (You don't need \( U(x, y, z) \) for solving the problem, and it is only provided for the exact physics context.)

The trajectory of the mass, i.e., its curve in space, \( \mathbf{r}(t) = (x(t), y(t), z(t)) \), is given by:

\[ x(t) = A \cos(\omega t) \]
\[ y(t) = B \cos(\omega t + \phi) \]
\[ z(t) = -\frac{1}{2} g t^2 + z_0 \]

where the amplitudes \( A \), \( B \), and the phase difference \( \phi \) are determined by the initial conditions, and the frequency is \( \omega = \sqrt{\frac{k}{m}} \).

Given: 

\[ A = 1 \]
\[ B = 2 \]
\[ \phi = \pi / 3 \]
\[ \omega = 0.5 \]
\[ g = 9.81 \]

Write a program that:

1. Reads the initial drop height \( z_0 \) from user input. 

**Explanation of Equations and Variables:**

- \( x(t) \) and \( y(t) \) describe the oscillatory motion of the mass in the x and y directions due to the springs.
- \( z(t) \) describes the parabolic motion of the mass under gravity after being dropped from height \( z_0 \).
- \( A \) and \( B \) are the amplitudes of oscillation in the x and y directions, respectively.
- \( \phi \) is the phase difference between the x and y oscillations.
- \( \omega \)
Transcribed Image Text:**Title: Dropped 2D Harmonic Oscillator** A mass \( m \) is held by two perpendicular identical springs in space in the x-y plane and is dropped from a height \( z_0 \) under the influence of gravity (let's call this the "dropped 2D harmonic oscillator"). The mass moves in a potential: \[ U(x, y, z) = \frac{1}{2} k (x^2 + y^2) + mgz \] where \( k \) is the spring constant and \( g \) is the acceleration due to gravity. The motion stops when the mass hits the ground at \( z = 0 \). (You don't need \( U(x, y, z) \) for solving the problem, and it is only provided for the exact physics context.) The trajectory of the mass, i.e., its curve in space, \( \mathbf{r}(t) = (x(t), y(t), z(t)) \), is given by: \[ x(t) = A \cos(\omega t) \] \[ y(t) = B \cos(\omega t + \phi) \] \[ z(t) = -\frac{1}{2} g t^2 + z_0 \] where the amplitudes \( A \), \( B \), and the phase difference \( \phi \) are determined by the initial conditions, and the frequency is \( \omega = \sqrt{\frac{k}{m}} \). Given: \[ A = 1 \] \[ B = 2 \] \[ \phi = \pi / 3 \] \[ \omega = 0.5 \] \[ g = 9.81 \] Write a program that: 1. Reads the initial drop height \( z_0 \) from user input. **Explanation of Equations and Variables:** - \( x(t) \) and \( y(t) \) describe the oscillatory motion of the mass in the x and y directions due to the springs. - \( z(t) \) describes the parabolic motion of the mass under gravity after being dropped from height \( z_0 \). - \( A \) and \( B \) are the amplitudes of oscillation in the x and y directions, respectively. - \( \phi \) is the phase difference between the x and y oscillations. - \( \omega \)
### Calculating the Trajectory and Contact Points of an Oscillator

This tutorial will guide you through the process of calculating the trajectory of an oscillator, determining the contact point with the ground, and computing the average coordinates.

#### Step 2: Calculating Trajectory

2. **Trajectory Calculation:** The program calculates the trajectory \( \mathbf{r}(t) \) and stores the coordinates for discrete time steps \( \Delta t \) as a nested list `trajectory` that contains:
   \[
   [[x_0, y_0, z_0], [x_1, y_1, z_1], [x_2, y_2, z_2], \ldots]
   \]
   - Start from time \( t = 0 \) and use a time step \( \Delta t = 0.01 \).
   - The last data point in the trajectory should be the time when the oscillator "hits the ground", i.e., \( z(t) \leq 0 \).

#### Step 3: Contact Points Computation

3. **Ground Contact Time:** Store the time for hitting the ground (i.e., the first time \( t \) when \( z(t) \leq 0 \)) in the variable `t_contact` and the corresponding positions in the variables `x_contact`, `y_contact`, and `z_contact`. Print the results as:
   ```plaintext
   t_contact = 1.430
   x_contact = 0.755
   y_contact = -0.380
   z_contact = ...
   ```
   *(Output floating point numbers with 3 decimals using `format()`, e.g., `t_contact = {:.3f}.format(t_contact)`.)* The partial example output above is for \( z_0 = 10 \).

#### Step 4: Average Coordinates Calculation

4. **Calculate Average Coordinates:** The average \( x \)- and \( y \)-coordinates are calculated as follows:
   \[
   \bar{x} = \frac{1}{N} \sum_{i=1}^{N} x_i
   \]
   \[
   \bar{y} = \frac{1}{N} \sum_{i=1}^{N} y_i
   \]
   where the \( x_i, y_i \) are the \( x(t), y(t) \) in the trajectory and \(
Transcribed Image Text:### Calculating the Trajectory and Contact Points of an Oscillator This tutorial will guide you through the process of calculating the trajectory of an oscillator, determining the contact point with the ground, and computing the average coordinates. #### Step 2: Calculating Trajectory 2. **Trajectory Calculation:** The program calculates the trajectory \( \mathbf{r}(t) \) and stores the coordinates for discrete time steps \( \Delta t \) as a nested list `trajectory` that contains: \[ [[x_0, y_0, z_0], [x_1, y_1, z_1], [x_2, y_2, z_2], \ldots] \] - Start from time \( t = 0 \) and use a time step \( \Delta t = 0.01 \). - The last data point in the trajectory should be the time when the oscillator "hits the ground", i.e., \( z(t) \leq 0 \). #### Step 3: Contact Points Computation 3. **Ground Contact Time:** Store the time for hitting the ground (i.e., the first time \( t \) when \( z(t) \leq 0 \)) in the variable `t_contact` and the corresponding positions in the variables `x_contact`, `y_contact`, and `z_contact`. Print the results as: ```plaintext t_contact = 1.430 x_contact = 0.755 y_contact = -0.380 z_contact = ... ``` *(Output floating point numbers with 3 decimals using `format()`, e.g., `t_contact = {:.3f}.format(t_contact)`.)* The partial example output above is for \( z_0 = 10 \). #### Step 4: Average Coordinates Calculation 4. **Calculate Average Coordinates:** The average \( x \)- and \( y \)-coordinates are calculated as follows: \[ \bar{x} = \frac{1}{N} \sum_{i=1}^{N} x_i \] \[ \bar{y} = \frac{1}{N} \sum_{i=1}^{N} y_i \] where the \( x_i, y_i \) are the \( x(t), y(t) \) in the trajectory and \(
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY