SpringProgram

SpringProgram - % we will discuss next week. So for the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
% program to solve eq. of motion of a mass-spring with friction % Doug Smith, 4/09 m=1; k=3; t=0; x=5; v=0; dt=0.01; % initial conditions alpha=0.2; % friction coefficient while t<30 F=-k*x-alpha*v; % spring force plus friction force a=F/m; t=t+dt; dv=a*dt; v=v+dv; dx=v*dt; x=x+dx; plot(t,x); hold on; end; % Note: this program will not directly run % in Octave since there are some set up issues % that I haven't explained to you yet, which
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % we will discuss next week. So for the quiz % just read this thru and make sure you understand % the concepts of the calculations % If you want to start using Octave, the first % step is just to try to get it installed and % use basic commands, as explained in &quot;Ch. 2&quot; % of my typed Physics 1C lecture notes, available % in the bookstore....
View Full Document

This note was uploaded on 04/09/2009 for the course PHYS 1B taught by Professor Briankeating during the Spring '07 term at UCSD.

Page1 / 2

SpringProgram - % we will discuss next week. So for the...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online