Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Matlab program (script or function or combination of both at your option) that simulates a two dimensional (x and y) trajectory of a

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Write a Matlab program (script or function or combination of both at your option) that simulates a two dimensional (x and y) trajectory of a mass, m, with a specified applied force. The state of this single mass system is given by the position and velocity: x, y, vx, vy. The core algorithm to update the state from values known at time step (n) to the next state at time step (n+1) is given by: x(n+1) = x(n) + dt * vx(n) y(n+1) = y(n) + dt* vy(n) vx(n+1) = vx(n) + dt * Ex(n)/m vy(n+1) = vy(n) + dt * Fy(n)/m Run your simulation for two sets of initial conditions and applied force: 1. Fx = 0; Fy=-9.8; x0 = 0; yO=0; vx0=2; vy0=10; m=1; For this case, find the value of x when y returns to zero. 2. Fx=0.5; Fy=-9.8; x0 = 0; yO=0; vx0 = 0; vy0 = 20; m = 1; Plot the resulting trajectory. Trajectory Simulation nf=1000 Analytics Velocity components vs time Velocity component 0. 51 1.5 225 Using 1000 time steps over 2.25 seconds provides sufficiently accurate results. A look at error associated with using larger time steps is shown in the next trajectory plot. The second homework condition results in the following trajectory and velocity time history: Trajectory Simulation Analytice 1000 Velocity components vs time Velocity component 0 0.5 1 1.5 2 2.5 3 3.5 4 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

Students also viewed these Databases questions