Homework 6 - BMED 2200 Modeling Biomedical Systems 1 Spring...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: BMED 2200 Modeling Biomedical Systems 1 Spring 2008 Homework 6 Solution 1) 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-600-400-200 200 400 600 800 HW6 Backward Finite Difference Approximation x y Real .1 .05 .025 .01 %Homework 6, Backward Finite Difference Approx clear; hValues = [.1 .05 .025 .01]; xValues = [0:.01:1]; y = inline( '(4*x^5-3*x^4+5*x^3+x^2-7)*sin(3*pi*x)' ); real2ndDy = inline( '(80*x^3-36*x^2+30*x+2)*sin(3*pi*x)+(20*x^4- 12*x^3+15*x^2+2*x)*6*pi*cos(3*pi*x)-(4*x^5-3*x^4+5*x^3+x^2- 7)*9*pi^2*sin(3*pi*x)' ); xIndex = 1; for x = xValues dy(1, xIndex) = real2ndDy(x); xIndex = xIndex + 1; end hIndex = 2; for h = hValues xIndex = 1; for x = xValues dy(hIndex, xIndex) = (y(x-2*h)-2*y(x-h)+y(x))*(1/h^2); xIndex = xIndex + 1; end hIndex = hIndex + 1; end plot(xValues, dy(1,:), xValues, dy(2,:), xValues, dy(3,:), xValues, dy(4,:), xValues, dy(5,:)); title( 'HW6 Backward Finite Difference Approximation' ) xlabel( 'x' ) ylabel( 'y' ) legend( 'Real' , '.1' , '.05' , '.025' , '.01' ) 0.1 0.20....
View Full Document

This homework help was uploaded on 04/17/2008 for the course BMED 2200 taught by Professor Robertspilker during the Spring '08 term at Rensselaer Polytechnic Institute.

Page1 / 6

Homework 6 - BMED 2200 Modeling Biomedical Systems 1 Spring...

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