lecture7RecursionReiterationE7part2

# lecture7RecursionReiterationE7part2 - E7 Spring 2010...

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

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 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 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: E7 Spring 2010: Lecture 7 Raja Sengupta College of Engineering University of California Berkeley Can you plot the motion of a rocket? Rocket speed vs. time (during burn) speed t ( ) = exhaustSpeed *log fullMass mass ( t ) Λ Ν Μ Ξ Π Ο With gravity : speed t ( ) = exhaustSpeed *log fullMass mass ( t ) Λ Ν Μ Ξ Π Ο − gt mass ( t ) = fullMass − burnRate * t height ( t ) = exhaustSpeed *log fullMass mass ( τ ) Λ Ν Μ Ξ Π Ο t ∫ d τ − g τ d τ t ∫ rocketTraj(20) Rocket speed vs. time (after burn) function [time,speed,height] = rocketTraj(fuelLoad) %fuelLoad in slugs %This program assumes the rocket starts from rest and goes %up vertically and falls back to earth the same way. %rocket parameters rocketMass = 100;%slug burnRate = 1;%slug/sec exhaustSpeed = 8000;%ft/sec: this is the effective fuel exit speed g = 32.2;%ft/sec/sec fullMass = rocketMass + fuelLoad; burnTime = fuelLoad/burnRate; timeGranularity = 0.01; maxCounter = (burnTime/timeGranularity)+1; %This loop computes the rocket speed and height upto the burn time for counter = 1:1:maxCounter, time(counter) = (counter-1)*timeGranularity; speed(counter) = exhaustSpeed*log(fullMass/(fullMass- burnRate*time(counter))) - g*time(counter); h1(counter) = exhaustSpeed*(fullMass - burnRate*time(counter))*log(fullMass - burnRate*time(counter))/burnRate; h2(counter) = exhaustSpeed*(log(fullMass)+1)*time(counter); h3(counter) = g*time(counter)^2; h4(counter) = fullMass*exhaustSpeed*log(fullMass)/burnRate; height(counter)= h1(counter) + h2(counter) - h3(counter) - h4(counter); end %This loop computes the rocket speed and height after the burn time while (ge(height(counter), 0)), counter = counter + 1; time(counter) = (counter-1)*timeGranularity; speed(counter) = speed(maxCounter) - g*(time(counter)-burnTime); height(counter) = height(maxCounter) + speed(maxCounter)*(time(counter) - burnTime) - g*((time(counter) - burnTime)^2)/2; end end Another cool link • http://www.youtube.com/watch?...
View Full Document

## This note was uploaded on 02/19/2010 for the course ENGINEERIN 72826 taught by Professor Sengupta/leachman/johnson during the Spring '10 term at Berkeley.

### Page1 / 28

lecture7RecursionReiterationE7part2 - E7 Spring 2010...

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

View Full Document
Ask a homework question - tutors are online