a) You will create a program that repeatedly multiplies a matrix by a point and plots...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
a) You will create a program that repeatedly multiplies a matrix by a point and plots the data to the screen. In this case, we will have a 2D point, (x,y). The point can be represented as a vector: v = [J]. We can also define a 2x2 matrix, M = [a . Computing the product of M with v gives us a new point v': Mv = v'. We can then use v' as the new point, multiply by matrix M again, and get another point, i.e. Mv' = v". This can go on indefinitely, creating a long sequence of points. Create a program that uses numpy to create a matrix and a point. Specifically, you should begin with the point (1, 0), and the matrix: [1.00583 10.087156 1.00156]. Then, repeatedly multiply the matrix by the point to get a new point. You should repeat this between 150 and 250 times. Note: the purpose of this part of the assignment is to get practice with numpy, so you should use numpy for your operations, even if you find it easier to perform this computation a different way. b) Then, make your program plot the data points, using matplotlib. Be sure to label the axes, and include a title. Your title should give a brief description of the shape that the points "trace"do out. Go to Settings to a a) You will create a program that repeatedly multiplies a matrix by a point and plots the data to the screen. In this case, we will have a 2D point, (x,y). The point can be represented as a vector: v = [J]. We can also define a 2x2 matrix, M = [a . Computing the product of M with v gives us a new point v': Mv = v'. We can then use v' as the new point, multiply by matrix M again, and get another point, i.e. Mv' = v". This can go on indefinitely, creating a long sequence of points. Create a program that uses numpy to create a matrix and a point. Specifically, you should begin with the point (1, 0), and the matrix: [1.00583 10.087156 1.00156]. Then, repeatedly multiply the matrix by the point to get a new point. You should repeat this between 150 and 250 times. Note: the purpose of this part of the assignment is to get practice with numpy, so you should use numpy for your operations, even if you find it easier to perform this computation a different way. b) Then, make your program plot the data points, using matplotlib. Be sure to label the axes, and include a title. Your title should give a brief description of the shape that the points "trace"do out. Go to Settings to a
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Write an alternative definition that is tail-recursive (iterative) and makes use of accumulator variables. [10 marks] Explain why your alternative definition executes more efficiently. [3 marks] 1...
-
PLEASE GIVE CORRECT ANSWERS Prove that the number of comparators in any sorting network is (n log n). [4 marks] (ii) What does Part (d)(i) imply in terms of the depth of any sorting network? [1 mark]...
-
What type of motor would you specify for a meat grinder if the motor is to be exposed?
-
(a) A wire loop is pulled away from a current-carrying wire (Fig. 21-47). What is the direction of the induced current in the loop: clockwise or counterclockwise? (b) What if the wire loop stays...
-
Using the trial balance provided in E5- 1, prepare a condensed, multiple- step income statement with all supporting schedules. In E5-1 Tamer Tire Company Tial Balance (Selected Accounts) For the Year...
-
Verify that the fluctuating component of velocity (2D assumption) satisfies the following equation: \[\begin{equation*}\frac{\partial v_{x}^{\prime}}{\partial x}+\frac{\partial...
-
Full-Capacity Sales Seaweed Mfg., Inc., is currently operating at only 90 percent of fixed asset capacity. Current sales are $610,000. How fast can sales grow before any new fixed assets are needed?
-
You are evaluating a project with the following cash flows: initial investment is $ - 1 1 , and the expected cash flows for years 1 - 3 are $ 6 , $ 1 4 and $ 1 1 ( all cash flows are in millions of...
-
2. Consulting: A University employs a Professor whose base output is a constant K. The Professor chooses to spend effort e consulting, giving her income pe at personal cost C(e) e/2. Unfortunately,...
-
A stock just paid a dividend of $1.06. The dividend is expected to grow at 23.78% for three years and then grow at 3.58% thereafter. The required return on the stock is 14.55%. What is the value of...
-
Check whether a given Binary Tree is a Perfect binary tree or not. The perfect binary tree- is a type of full binary trees in which each non-leaf node has exactly two child nodes.
-
What are non-banking financial intermediaries? List the different types and briefly explain their role in connecting savers with borrowers in the financial system.
-
Suppose that debit cards, ATMs, ACH transactions, and other forms of electronic funds transfers did not exist. How would this change the way you shop and pay bills? How would transactions costs in...
-
What is the appeal of the eurocurrency market?
-
What is the appeal of trade shows and trade missions for small and medium-sized companies?
-
Consider the following configuration of fixed, uniformly charged spheres in (Figure 1) : a blue sphere fixed at the origin with positive charge q, a red sphere fixed at the point (d1,0) with unknown...
-
According to a recent survey, 40% of millennials (those born in the 1980s or 1990s) view themselves more as spenders than savers. The survey also reveals that 75% of millennials view social...
-
Find Io in the network in figure using nodal analysis. 10 6/0 v 202 20 12/0 v -j1n= (1)2/0v j2n
-
An abc-sequence balanced three-phase wye-connected source supplies power to a balanced wye-connected load. The line impedance per phase is 1 + j10, and the load impedance per phase is 20 + j20. If...
-
The voltage across a 2-F capacitor is given by the waveform in figure. Find the waveform for the current in thecapacitor. vdt) (V), +12 50 10 20 30 40 t (s) -12
-
Consider the following cash flow profile and assume MARR is 10 percent/year and the finance rate is 4 percent/year. a. Determine the MIRR for this project. b. Is this project economically attractive?...
-
Consider the following cash flow profile and assume MARR is 10 percent/year and the finance rate is 4 percent/year. a. Determine the MIRR for this project. b. Is this project economically attractive?...
-
A university pumps its water from wells located on campus. The falling water table has caused pumping costs to increase, the quantity of water available to decrease, and the quality of water to...
Study smarter with the SolutionInn App