hw9problem3 - fprintf('\nThe time when the third minimum...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Homework 9 Problem 3 % Fall 2008 % Numerical Analysis clear clc % ---- INPUTS ---- func_y = 'exp(-0.01)*sin(2*x) + cos(3*x)'; %---- CALCULATIONS & OUTPUT ---- fplot(func_y, [0 10], 'b') grid on xlabel('Time in seconds') ylabel('Control Effort (N-m)') title('Control Effort for a Servo Unit Operating a Radar Tracking System') func_min1 = fminbnd(func_y, 0.9, 1.5); func_min2 = fminbnd(func_y, 2.5, 3.5); func_min3 = fminbnd(func_y, 5.0, 6.0); func_min4 = fminbnd(func_y, 7.0, 8.0); func_min5 = fminbnd(func_y, 9.0, 10.0); fprintf('\nThe time when the first minimum torque occurs is: %.4f seconds\n', func_min1); fprintf('\nThe time when the second minimum torque occurs is: %.4f seconds\n', func_min2);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: fprintf('\nThe time when the third minimum torque occurs is: %.4f seconds\n', func_min3); fprintf('\nThe time when the fourth minimum torque occurs is: %.4f seconds\n', func_min4); fprintf('\nThe time when the fifth minimum torque occurs is: %.4f seconds\n', func_min5); %---- OUTPUT ----% The time when the first minimum torque occurs is: 1.2249 seconds % % The time when the second minimum torque occurs is: 2.9270 seconds % % The time when the third minimum torque occurs is: 5.3153 seconds % % The time when the fourth minimum torque occurs is: 7.5081 seconds % % The time when the fifth minimum torque occurs is: 9.2102 seconds...
View Full 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.

Ask a homework question - tutors are online