This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: % Store new solution v(i,1) = vnew end % Compare with analytic solution to see how good our final value % of v is. Note that we cannot normally do this, but we will do it % here to develop an understanding of what factors influence the % accuracy of the numerical solution. vtrue = sqrt(m*g/c)*tanh(sqrt(g*c/m)*t(npts,1)) fprintf('The numerical final velocity is %7.4f m/s\n', v(npts,1)) fprintf('and the analytical final velocity is %7.4f m/s.\n', vtrue) Sheet1 Page 2 % We need an initial condition on v - why, and why call it vnew? % Pre-allocate memory for v...
View Full Document
This note was uploaded on 09/05/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.
- Spring '09