sol_hw10 - CE 335 Solutions to Homework 10 6) %letz=[xv]...

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

View Full Document Right Arrow Icon
CE 335 Solutions to Homework 10 6) %let z = [x v] g0 = 9.8; R = 6.37E6; R2 = R^2; dzdt = @(t, z) [z(2) -g0*(R2 / (R + z(1))^2)]; %timescale until projectile reaches maximum height: v0/g ~ 150 s h = 1; nt = 200; z(1, :) = [0 1400]; for i = 1:nt t = h*i; z(i + 1, :) = z(i, :) + h*dzdt(t, z(i, :)); %Euler's method end hmax = max(z(:, 1)); which gives us 102.3 km at 147 s. 22) %let z = [x1 v1 x2 v2 x3 v3] k1 = 3E6; k2 = 2.4E6; k3 = 1.8E6; m1 = 12E3; m2 = 10E3; m3 = 8E3; dzdt = @(t, z) [z(2) -(k1/m1) * z(1) + (k2/m1) * (z(3)-z(1)) z(4)  (k2/m2) * (z(1)-z(3)) + (k3/m2) * (z(5)-z(3)) z(6) k3/m3 * (z(3)-z(5 ))]; %initial condition z(1, :) = [0 1 0 0 0 0]; %timescale for oscillations is given by sqrt(m/k) ~ 0.06 s --> need h  at least this small for stability h = 0.01; nt = ceil(20 / h); for i = 1:nt t = h * (i - 1); K1 = dzdt(t, z(i, :)); K2 = dzdt(t + h/2, z(i, :) + h*K1/2);
Background image of page 1

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

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

This note was uploaded on 08/30/2011 for the course CGN 3350 taught by Professor Lybas during the Spring '11 term at University of Florida.

Page1 / 8

sol_hw10 - CE 335 Solutions to Homework 10 6) %letz=[xv]...

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