Question

Introduction:

During the Lecture, you learned how to calculate the sine,

cosine, and tangent of an angle. Remember the angle had to be

expressed in radians in the trigonometric function.

Using np.deg2rad command degrees are converted to

radians.

Example: To find the sine of 90 degrees, you can use:

np.sin(np.deg2rad(90))

Questions:

1. Using the NumPy package, develop a Python program that

calculates the sine, cosine, and tangent of the following

angles. Display the result on the screen with the correct

label.

0, 45, 90, 135, 180, 225, 270, 315, 360

2. Develop a Python program that calculates the inverse sine,

cosine and tangent, (arsin, arcos, and arctan) of the

following numbers. Display the result on the screen with

the correct label.

0, 45, 90, 135, 180, 225, 270, 315, 360

3. Round the following numbers and display the results. Make

a comment about the differences in the rounding.

• 5.1234 with decimals=2

• 5.1254 with decimals - 2

• 54.12545 with decimals - -1

55.12545 with decimals--1

4. Create the following numpy array: x-[3.1, 3.5, 4.5, 2.9,

-3.1, -3.5, -5.9]. Then find and display the following:

• around of x

floor of x

• Ceil of x

• trunc x

5. Using numpy create two matrices A and B as:

A and B =

Then, find and display the following: A+B, 2A, 2A + 5B,

5A-2A, A*B, A^2, A^2+ B^2.

6. Write a Python program to solve the following system of

linear equations.

Find the solution for w, x, y and z. Note: You need to

Then the solution will

construct a matrix A and b as follow.

be A^(-1) b

A-, b-

7. Solve the following system of linear equations using the

same method used in question 6.

x₂ + x₂-x3 + x₂

2x₂ + 2x₂ - xy + x₂

= 0

4x₁-x₂+2x₂ + 5x

= 3

-₁ +1.5x₂-2.7x+0.5x4 - 0.5

8. Solve the following circuit for current in loop A, B and C.

Use the following system of linear equations.

-15+385,-)+385,-)

0681,-1,3-0881, +0.567,-

415V

Lopp

2

&

w

10002

Loop C

A₂

100

Question image 1