Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB QUESTION Problem 3: A car, initially at rest, accelerates in x direction with the following expression: where a is acceleration and t is time.

MATLAB QUESTION image text in transcribed
Problem 3: A car, initially at rest, accelerates in x direction with the following expression: where a is acceleration and t is time. In this exercise, you are to explore the motion of the car numerically using Euler method. The motion is described by the following differential equations: where u is velocity. Using Euler method and capital letters to denote the approximation, the equations can be approximated by where subscript n denotes variables at current time, subscript n+1 denotes variables at a time that is , ahead. Write function car.m to uerically solve for the motion of the car. The fumction should have the following header: function [T, X, U] car(Tf. dt). The inputs are total traveling time Tf and the time step dt. The outputs vectors T, X and U are the time, distance and velocity of the car, respectively. Give the function a description (a) Set p3azwalc("help car'). (b,c,d) Use function car to get the time, distance, and velocity of the car for T Set the answers to p3b, p3c, and p3d, respectively. Use 10-second time step. 60 s (e,fg) Repeat the step above with 1-second time step. Put the time, distance, and velocity into p3e, pf, and p3g, respectively h) Create figure 1. Use function subplot to include 2 panels with one on top of the other. Plot distance versus time in the top panel. The top panel should include 2 curves: the 10-second time step in parts (b,c) and the 1-second time step in parts (e,f). Plot veloe- ity versus time in the bottom panel. The bottom panel should also inelude 2 curves: the 10-second time step in parts (b,d) and the 1-second time step in parts (eg). Use different solid symbols (no line) for the curves. Set p3h-See figure 1 An 4-point ertra credit wll be given if you include the analytical solution of the distance and velocity in the figure. Use solid line to denote the solution which can be obtained by integrating the differential equations as ou had done in your math/physics class

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

More Books

Students also viewed these Databases questions

Question

1. Define the concept of brands and branding.

Answered: 1 week ago

Question

Technology. Refer to Case

Answered: 1 week ago