{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

02 Matlab and Roots I

02 Matlab and Roots I - Problem .Theareaoftheroomis 20m2....

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1/10/2013 1 Problem: A room is 4m longer than it is wide. The area of the room is 20m 2 . What is the width of the room? Let x be the width of the room. Then the area of the room is x ( x + 4) = x 2 + 4x Equating this to the given area gives x 2 + 4x = 20 Rearranging gives x 2 + 4x – 20 = 0 The problem is a “root finding” problem. Root Finding Problems: General form: find x such that f ( x ) = 0 The values of x for which f ( x ) = 0 are the roots of f ( x ) c bx ax x f ) ( 2 For our problem f ( x ) happens to be a quadratic . The roots can be found using the quadratic formula. a ac b b x x roots 2 4 , 2 2 1 In general there are two roots. One is obtained by using + in the formula and the other by using . If the quantity under the square root is zero the roots are equal. If this quantity is negative the roots are complex numbers.
Image of page 1

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

View Full Document Right Arrow Icon
1/10/2013 2 Casio Calculator Note Casio calculators can solve quadratics. Hit Mode until menu include “EQN”. Then select this option. Use the right arrow to move from “Unknowns?” to “Degree?” Enter 2 (a quadratic is a second degree polynomial) Enter values for a , b , and c (hit “=“ after each value) Use the up and down arrows to move between the two solutions. If the roots are complex numbers shift plus “=“ toggles between the real and imaginary parts of each solution. If the roots are real this key combination has no effect. The display does not indicate the roots are real or complex (use shift plus “=“ to find out). At its simplest Matlab is just a high priced calculator Typing an expression after the command prompt causes Matlab to output the value of the expression. >> 1+1 ans = 2 >> 2^3 ans = 8 >> 2*3+4 ans = 10 >> 2*(3+4) ans = 14 Points to remember: ^ is exponentiation The usual rules of precedence apply
Image of page 2
1/10/2013 3 Assigning to a name creates a memory (variable) and gives it a value.
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.