hw9problem4 - % Homework 9 Problem 4 % Fall 2008 %...

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

View Full Document Right Arrow Icon
% Homework 9 Problem 4 % Fall 2008 % Numerical Analysis clear clc % ---- INPUTS ---- % Step A func_y = '(2 - 6*sin(5*x - 2))/ exp(x)'; %---- CALCULATIONS & OUTPUT ---- % Step B figure(1) fplot(func_y, [0 6], 'b') grid on xlabel('Time in seconds') ylabel('Displacement in mm') title('Heart Valve Controller Arm Displacement') % Step C Zero_Guess = input('\nGuess the initial time at which the zero occurs: '); Default_Pos_Time = fzero(func_y, Zero_Guess); fprintf('\nFirst time when the controller arm is at zero displacement is %.4f seconds \n', Default_Pos_Time); % Step D x_min = input ('\nPlease enter the lower limit of the range (min value): '); x_max = input ('\nPlease enter the upper limit of the range (max value): '); func_min = fminbnd(func_y, x_min, x_max); fprintf('\nThe time when the minimum displacement occurs within the range is: %.4f seconds\n', func_min); % Step E x = func_min; disp_m = eval(func_y); fprintf('\nThe displacement at %.4f seconds is: %.4f mm\n', x, disp_m); % Step F
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 02/12/2012 for the course ENGR 126 taught by Professor Oakes during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 2

hw9problem4 - % Homework 9 Problem 4 % Fall 2008 %...

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