Question: 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:

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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!