HW8_jruzmora

# HW8_jruzmora - title('Interest compunded continously for 30...

This preview shows pages 1–6. Sign up to view the full content.

Sheet1 Page 1 %Chapter 4 Problem 4 %This program combines 4 plots into one figure clear all clc figure(1) subplot(2,2,1) t=0:20 g=9.8 a=pi/4 v=100 H_t=t*v*cos(a) V_t=t*v*sin(a)-(0.5*g*t.^2) plot(t,H_t) title('Distance traveled in the x direction') xlabel('Time [s]') ylabel('Horizontal distance [m]') subplot(2,2,2) plot(t,V_t) title('Distance traveled in the y direction') xlabel('Time [s]') ylabel('Vertical distance [m]') subplot(2,2,3) plot(H_t,V_t) title('Distance traveled') xlabel('Horizontal distance [m]') ylabel('Vertical distance [m]') subplot(2,2,4) t=0:20 g=9.8 a_1=pi/2 a_2=pi/4 a_3=pi/6 v=100 H_1=t*v*cos(a_1) H_2=t*v*cos(a_2) H_3=t*v*cos(a_3) V_1=t*v*sin(a_1)-(0.5)*g*t.^2 V_2=t*v*sin(a_2)-(0.5)*g*t.^2 V_3=t*v*sin(a_3)-(0.5)*g*t.^2 plot(H_1,V_1,'-',H_2,V_2,':',H_3,V_3,'--') xlabel('Horizontal distance [m]') ylabel('Vertical distance [m]') legend('H_1vsV_1','H_2,V_2','H_3,V_3')

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Sheet1 Page 2 %Chapter 4 Problem 5 %This program calculates interest componded continously clear all clc p_0=1000 r=0.08 t=1:30 P=p_0*exp(r*t) plot(t,P)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: title('Interest compunded continously for 30 years') xlabel('Time') ylabel('Current Balance') %Chapter 4 Problem 11 %Plot using the mesh command clear all clc x=linspace(-3,3,100) y=linspace(-3,3,100) [new_x, new_y]=meshgrid(x,y) z=3*(1-new_x).^2.*exp(-(new_x.^2)-(new_y+1).^2)-10*(new_x/5-new_x.^3-new_y.^5).*exp(-new_x.^2-new_y.^2)-1/3*exp(-(ne w mesh(z) xlabel('x') ylabel('y') zlabel('z') Sheet1 Page 3 %Chapter 4 Problem 12 %This plots using the surf command clear all clc x=linspace(-3,3,100) y=linspace(-3,3,100) [new_x, new_y]=meshgrid(x,y) z=3*(1-new_x).^2.*exp(-(new_x.^2)-(new_y+1).^2)-10*(new_x/5-new_x.^3-new_y.^5).*exp(-new_x.^2-new_y.^2)-1/3*exp(-(ne w figure subplot(2,2,1) surf(new_x,new_y,z) xlabel('x') ylabel('y') zlabel('z') subplot(2,2,2) surf(z) xlabel('x') ylabel('y') zlabel('z') Sheet1 Page 4 %seconds %m/s^2 %45 degrees %m/s %seconds %m/s^2 %m/s Sheet1 Page 5 %Initial amount %time for 30 years ) Sheet1 Page 6 )...
View Full Document

## This note was uploaded on 05/21/2010 for the course EEL 2161 taught by Professor Lopez during the Spring '10 term at FAU.

### Page1 / 6

HW8_jruzmora - title('Interest compunded continously for 30...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online