Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python code error problem. I need help on fixing this problem. Error: Codes: import numpy as np import matplotlib.pyplot as plt # Constants z =

Python code error problem. I need help on fixing this problem.

Error:

image text in transcribed

Codes:

import numpy as np import matplotlib.pyplot as plt

# Constants z = 0.13562 + 0.84869j # ohm / mi y = 4.97e-6j # siemens / mi V_s = np.array([[161e3], [0]])

# Distance range d = np.linspace(0, 200, 1000) # miles

# Propagation constant gammad = np.sqrt(y * z) * d

# Transmission matrix T = np.array([[np.cos(gammad), 1j*np.sin(gammad)/y], [1j*y*np.sin(gammad), np.cos(gammad)]])

# Receiving end voltage V_r = T @ V_s mag_V_r = np.abs(V_r)

# Plot magnitude of receiving end voltage as a function of distance plt.plot(d, mag_V_r) plt.xlabel('Distance (mi)') plt.ylabel('|V_r| (V)') plt.show()

ValueEnror: matmul: Input operand 1 has a mismatch in its core dimension , with gufunc signature (n?,k),(k,m?)>(n?,m?) (size 2 is different from 1000) In [8]

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

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago