Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Activity #1: Pretty plot - individual Create a program named pretty_plot.py that repeatedly multiplies a matrix by a point and plots the results. Start
Activity #1: Pretty plot - individual Create a program named pretty_plot.py that repeatedly multiplies a matrix by a point and plots the results. Start with a 2D point, (?,?). This point can be represented as a vector: v = [7]. There is also defined a 2x2 matrix, M = [?]. Computing the product of M with u will give a new point u': v = Mu. Then, multiply the matrix M by the new point u', to get another point, i.e. v" = Mu'. This can go on indefinitely, creating a long sequence of points. Your program should use numpy to create a matrix and a point. Begin with the point (0, 1) and the 1.01 0.09 matrix: 0.09 1.01 1. Then, multiply the matrix by the point to get a new point. Repeat for a total of 200 times. Have your program plot the data points using matplotlib. Be sure to label the x and y axes, and include a title. Your title should give a brief description of the shape that the points "trace" out. Note: the purpose of this activity 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started