ME 218 - HW 10 - 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1...

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

View Full Document Right Arrow Icon
Ravi Singh ME 218 – T 5-7 HW #10 1. a. 1 st set: T(0) = 40 ˚C and T’(0) = 10 ˚C/m 2 nd set: T(0) = 40 ˚C and T’(0) = 15 ˚C/m b. 0 1 2 3 4 5 6 7 8 9 10 40 60 80 100 120 140 160 180 200 Ravi Singh: Heating Rod x (m) Temperature (degrees C) xspan=[0, 10]; t0=40; y0=10; z0=[t0,y0]; [x, z]=ode45( 'heatbar' , xspan, z0); y=z(:,1); ft(1)=y(length(x)); y0(1) = y0; y0(2) = 15; [x, z]=ode45( 'heatbar' , xspan, [t0,y0(2)]); y=z(:,1); ft(2) = y(length(x)); y0(3) = (200*(y0(2)-y0(1))+(ft(1,2)*y0(1)-ft(1,1)*y0(2)))/(ft(1,2)- ft(1,1)); [x, z]=ode45( 'heatbar' , xspan, [t0,y0(3)]); y=z(:,1); ft(3)=y(length(x)); y0(4) = (200*(y0(2)-y0(3))+(ft(1,2)*y0(3)-ft(1,3)*y0(2)))/(ft(1,2)- ft(1,3)); [x, z]=ode45( 'heatbar' , xspan, [t0,y0(4)]);
Background image of page 1

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

View Full DocumentRight Arrow Icon
y=z(:,1); plot(x, y),title( 'Ravi Singh: Heating Rod' ),xlabel( 'x (m)' ),ylabel( 'Temperature (degrees C)' ); and function zprime=heatbar(x,z) h=0.01; ta = 20; zprime=[ z(2); -h*(ta-z(1)); ]; 2. After 4 iterations of the bisection method y(0)=0.1875
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.185 0.19 0.195 0.2 0.205 0.21 0.215 Ravi Singh x y xspan=[0, 1]; x0=0; y0=0; z0=[x0,y0]; [x, z]=ode45( 'hw10prob' , xspan, z0); y=z(:,1); fs(1)=z(length(x),2); x0(1) = x0; x0(2) = 1; z0=[x0(2),y0]; [x, z]=ode45( 'hw10prob' , xspan, z0); y=z(:,1); fs(2)=z(length(x),2); i=1; while (i<5) x0(i+2)=(x0(1)+x0(2))/2; [x, z]=ode45( 'hw10prob' , xspan, [x0(i+2),y0]); y=z(:,1); fs(i+2)=z(length(x),2); if (fs(1,i+2)*fs(1,1)<0) x0(2)=x0(i+2); else x0(1)=x0(i+2); end i=i+1; end x0(i+1) plot(x,y),title( 'Ravi Singh' ),xlabel( 'x' ),ylabel( 'y' ) For comparison, after 20 iterations of bisection, y(0) = 0.1604 and the slope is clearly zero on both ends. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.16 0.161 0.162 0.163 0.164 0.165 0.166 0.167 0.168 Ravi Singh x y...
View Full Document

This note was uploaded on 06/23/2011 for the course ME 218 taught by Professor Unknown during the Fall '08 term at University of Texas.

Page1 / 3

ME 218 - HW 10 - 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1...

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

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