Assinment 1
Assinment 1
Assinment 1
2(a) If acceleration value is given at different time interval, find the velocity using
discrete integration method.
I 0 1 2 3 4 5
ti(seconds) 0 0.1 0.2 0.3 0.4 0.5
ai ( m/s2) 0 1.43 2.8 4.13 5.6 7.21
(c) A car sits in an entrance ramp to a freeway, waiting for a break in traffic. The
driver sees a small gap between two vehicles and accelerates with constant
acceleration along the ramp onto the freeway. The car starts from rest, moves in a
straight line, and has a speed of 20 m/s when it reaches the end of the 120-m ramp.
What is the acceleration of the car?
3) Position and Velocity of a Ball If a stationary ball is released at a
height(h0=50m) above the surface of the Earth with a vertical velocity(v 0=10m/s) ,
the position and velocity of the ball as a function of time will be given by the
equations where g is the acceleration due to gravity ( 9.81), h is the height above
the surface of the Earth (assuming no air friction), and v is the vertical component
of velocity. Write a MATLAB program that prompts a user for the initial height of
the ball in meters and velocity of the ball in meters per second, and plots the height
and velocity as a function of time.Be sure to include proper labels in your plots.
5) The cost of sending a package by an express delivery service is $15.00 for the
first two pounds, and $5.00 for each pound or fraction thereof over two pounds. If
the package weighs more than 70 pounds, a $15.00 excess weight surcharge is
added to the cost. No package over 100 pounds will be accepted. Write a program
that accepts the weight of a package in pounds and computes the cost of mailing
the package. Be sure to handle the case of overweight packages.
6) Suppose a ball is thrown upwards with initial velocity, u=2m/s. It also suffers air
resistance during its motion. Solve the problem in MATLAB to find the maximum
height attained by the ball. Given D=0.0245m-1. Also give the plots of
acceleration,velocity and position versus time in three separate subplots till the ball
attains maximum height.
8)Space shuttle launch. When the space shuttle is lifting off, the vertical positions
for the first 10 s in 1 s intervals are given as
t(s) 0 1 2 3 4 5 6 7 8 9
y(m) 0 15 60 135 240 375 540 735 960 1215
(a) Draw the motion diagram and the displacements for this motion.
(b) Use the motion diagram to find the average velocity as a function of time
afterlift-off.
(c) Use the motion diagram to find the average acceleration as a function of time
afterlift off.
9)write a script and plot for the following functions using subplot command
f=sin(x)/x,y=e-x2 ,z=x2-10x+15 where x 5 x 5
10) Find out the run time error in the following MATLAB programs.
(a) for i=1:2:6;
x(i)=i^2;
end
(b) x=[ 0 7 8.3 71 4] ;
y= [ 0 9 4 2; 4.5 1] ;
z=x+y;
(c ) t=0:0.1:1;
x=linspace(0,1,10);
plot(t,x) ;
11) Predict the outcome of following programs manually?
(a) clc; clear all; close all;
x=linspace(5,1,7);
i=1;
while(x(i)>2)
i=i+1;
end
i