{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Homework 4

# Homework 4

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

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

Unformatted text preview: Homework 4 Lectures 13‐16 Math 344 Ohio University Spring Quarter 09’‐10’ Bob Benjamin Astrom Elbert 13.1) %L13P1 %Math 344 %Homework Problem 13.1 % or %Homework Lecture 13 Problem 1 ==> (L13P1) %Written by Bob Astrom and Ben Elbert format long n=50; % set some number of iterations, may need adjusting m=60; % Set number of iterations for initial guess lasty = [0; 0]; % Set vector to identify answer change filler = 0; % Just a place holder not important AnswerNumber=0; % Set counter for the number of the answer f = inline('[(x(1).^2/186.^2) - (x(2).^2/(300.^2 - 186.^2)) - 1 ; ((x(2) 500).^2/279.^2) - ((x(1) - 300).^2/(500.^2 - 279.^2)) - 1]'); % the vector function Df = inline('[2*(x(1)/186^2), -2*(x(2)/(300^2 - 186^2)) ; -2*((x(1) 300)/(500.^2 - 279.^2)), 2*((x(2) - 500)/279.^2)]'); % the matrix of partial derivatives for l = 1:m % Loop to change initial guess x = [10*l;10*l]; % Initial guess InitialGuess = x; % Store initial guess for later display for i = 1:n % Loop for actual calculation Dx = -Df(x)\f(x); % solve for increment x = x + Dx; % add on to get new guess f(x); % see if f(x) is really zero end % End calculation loop y = x*1000; % Decimal place shift for rounding y = round(y); % Creat rounded answers for uniqueness test if y == lasty % Check to see if answer has not changed filler = 0; % Here just for the heck of it else % Check to see if answer has changed AnswerNumber = AnswerNumber + 1 % Answer # counter and display InitialGuess % Display initial...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern