====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gibson:teaching:spring-2016:math445:lab4 [2016/02/08 11:37] gibson created |
gibson:teaching:spring-2016:math445:lab4 [2016/02/11 08:40] (current) gibson |
||
---|---|---|---|
Line 99: | Line 99: | ||
what vector $x$ satisfies $Ax=b$? Solve with pencil and paper and with Matlab. | what vector $x$ satisfies $Ax=b$? Solve with pencil and paper and with Matlab. | ||
- | **Problem 4:** Use Matlab to solve the problem. Nilanjana has 40 coins worth %%$%%6.40. They're all quarters and nickels. How many nickels and how many quarters does she have? Verify that your answer solves the problem. | + | |
+ | **Problem 4:** Solve the following systems of equations numerically with Matlab. | ||
+ | |||
+ | **(a)** | ||
+ | <latex> \quad | ||
+ | \begin{align*} | ||
+ | 2x -y &= 8 \\ | ||
+ | 6x-5y &= 32 \\ | ||
+ | \end{align*} | ||
+ | </latex> | ||
+ | |||
+ | |||
+ | **(b)** | ||
+ | <latex> \quad | ||
+ | \begin{align*} | ||
+ | y + z &= 6 \\ | ||
+ | 3x-y+z &= -7 \\ | ||
+ | x+y-3z &= -13 | ||
+ | \end{align*} | ||
+ | </latex> | ||
+ | |||
+ | **%%(c)%%** | ||
+ | <latex> \quad | ||
+ | \begin{align*} | ||
+ | 2x + y - 3z &= 0 \\ | ||
+ | 6x +3y -8z &= 0 \\ | ||
+ | 2x -y + 5z &= -4 | ||
+ | \end{align*} | ||
+ | </latex> | ||
+ | |||
+ | **Problem 5:** Use Matlab to solve the problem. Nilanjana has 40 coins worth %%$%%6.40. They're all quarters and nickels. How many nickels and how many quarters does she have? Verify that your answer solves the problem. | ||
Hint: convert the story problem to an $Ax=b$ problem and then solve that with Matlab. | Hint: convert the story problem to an $Ax=b$ problem and then solve that with Matlab. | ||
- | **Problem 5:** Use Matlab to solve the problem. Suhasini has 44 coins worth %%$%%7.50. They're all quarter, dimes, and nickels. She has twice as many dimes as nickels. How many of each type of coin does she have? Find the answer, and then verify that the solution satisfies the problem. | + | **Problem 6:** Use Matlab to solve the problem. Suhasini has 44 coins worth %%$%%7.50. They're all quarter, dimes, and nickels. She has twice as many dimes as nickels. How many of each type of coin does she have? Find the answer, and then verify that the solution satisfies the problem. |
- | **Problem 6:** Use Matlab to solve the following problem (from //Numerical Computing with Matlab// by Clive Moler). | + | **Problem 7:** Use Matlab to solve the following problem (from //Numerical Computing with Matlab// by Clive Moler). |
{{:gibson:teaching:fall-2012:math445:truss2.png?direct&600}} | {{:gibson:teaching:fall-2012:math445:truss2.png?direct&600}} | ||
Line 111: | Line 141: | ||
{{:gibson:teaching:fall-2012:math445:truss3.png?direct&600}} | {{:gibson:teaching:fall-2012:math445:truss3.png?direct&600}} | ||
- | {{:gibson:te | + | {{:gibson:teaching:fall-2012:math445:truss4.png?direct&600}} |
+ | |||
+ | One of the main challenges of this problem is figuring out how to enter the elements of the matrix quickly and reliably. For a small matrix, it's easy to type out the matrix explicitly like ''A = [ 1 9 7 ; 4 3 8 ; 6 2 0]'', but for a 13 x 13 matrix with 169 elements, that's tedious and error prone. |