{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw9problem4

# hw9problem4 - Homework 9 Problem 4 Fall 2008 Numerical...

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

% 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 func_n = '-(2 - 6*sin(5*x - 2))/ exp(x)'; % func_n = ['-(' func_y ')']; % Step G figure(2) fplot(func_n, [0 6], 'r') grid on xlabel('Time (seconds)')

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

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

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

View Full Document
Ask a homework question - tutors are online