Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please include all of your code and a picture of the code. Please answer questions 5 and 6. Equations (1) cos(to) sin(to) cos(2to) sin(2to) cos(t1)

Please include all of your code and a picture of the code. Please answer questions 5 and 6.

image text in transcribedimage text in transcribedimage text in transcribed
Equations (1) cos(to) sin(to) cos(2to) sin(2to) cos(t1) sin(t1) cos(2t1) sin(2t1) X = 1 cos(t2) sin(t2) cos(2t2) sin(2t2) . . : . . . . . . cos(1628) sin(t628) cos(2t628) sin(2628) (2) ao 0.456019 0.182184 B = (XTX) -IXTY = = 0.0906583 -0.0156325 b2 -0.0411362Time Amplitude (milliseconds) (millivolts) 0.00 0.429086 0.01 0.454173 0.02 0.433519 0.03 0.518289 0.04 0.40911 0.05 0.462929 . . . . . . 6.27 0.557813 6.28 0.469532 Table 1. A sample of the data contained in Lab 7data . CSV.Problem 5 1. Using the matrix x2 and the vector Y, compute the coefficient matrix of the normal equations x X and save it as the variable normal_coef2. Then compute the right-hand side of the normal equations XY and save it as the variable normal vector2. 2. Solve the normal equations xX/ = X]Y. Save your answer as the variable beta2 and compare your answer to the vector in equation (2). As in Lab 6 and elsewhere in this lab, use the function np . linalg . solve with the matrix normal coef2 and vector normal_vect2 to solve for beta2. Quick Note You can check your answers by computing XTXB - XTY in a practice notebook. You should get an array whose values are very close to zero (they won't be exactly zero, due to round- off error). Problem 6 Define the function f2(t) in your code as f2 (t) . In other words, f2 (t) should return the same value as f2(t) . Quick Note For any t, your function should take the vectors beta2 and row func (t, 2) and return their dot product. Notice that you will need to convert the list row_func (t , 2) to a NumPy array before taking the dot product with beta2. Test Cases You can test that your code is correct by evaluating these commands and comparing outputs: 12 (0 . 75)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions