Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python numpy中的错误:ufunc';乘';未包含具有签名匹配类型的循环_Python_Numpy_Math_Numpy Ufunc_Wxmathplot - Fatal编程技术网

Python numpy中的错误:ufunc';乘';未包含具有签名匹配类型的循环

Python numpy中的错误:ufunc';乘';未包含具有签名匹配类型的循环,python,numpy,math,numpy-ufunc,wxmathplot,Python,Numpy,Math,Numpy Ufunc,Wxmathplot,在控制台中获取错误 回溯(最近一次呼叫最后一次): 文件“C:\Users\user\PycharmProjects\NAS2\main.py”,第29行,在 二次信号[2]=(KVar*X-角频率*T+相位) numpy.core.\u exceptions.ufunctype错误:ufunc“multiply”不包含具有签名匹配类型(dtype)的循环('相关变量具有字符串dtype。它们不能相乘。请在使用前转换为数字dtype。 import numpy as np import matp

在控制台中获取错误

回溯(最近一次呼叫最后一次): 文件“C:\Users\user\PycharmProjects\NAS2\main.py”,第29行,在 二次信号[2]=(KVar*X-角频率*T+相位)
numpy.core.\u exceptions.ufunctype错误:ufunc“multiply”不包含具有签名匹配类型(dtype)的循环('相关变量具有字符串dtype。它们不能相乘。请在使用前转换为数字dtype。
import numpy as np
import matplotlib.pyplot as plt

# required library for plots and graphs
np.seterr(divide='ignore')
Frequency = np.zeros(2)
Amplitude = np.zeros(2)
Phase = np.zeros(4)
SOL = 3 * 10^8
AngularFrequency = 2 * 3.14 * Frequency
WL = SOL / Frequency
KVar = 6.28 / WL
for i in range(5):
print(f"Signal input values{i + 1}")
Phase = input("How many phases is this signal going through?")
Frequency = input("What is your desired frequency?")
Amplitude = input("What is your desired amplitude?")
X = input("Please enter the full input distance of this signal?")
T = input("Please enter the amount of time this signal will be running for?")
# The block above concerns the user for his/her inputs for the graph along
# with setting the needed formulae/values for the signal graph

SecondarySIG[2] = (KVar * X - AngularFrequency * T + Phase)
PrimarySIG[1] = (KVar * X - AngularFrequency * T + Phase)
CUL = PrimarySIG[3] + SecondarySIG
# Essential Formulae for the Signals

fig, axes = plt.subplots(5, 2)
axes[2].plot(T, SecondarySIG)
axes[1].plot(T, PrimarySIG)
axes[3].plot(T, CUL)
# Declares plotable canvas for the graphs

print("Graphs of Signal 1, Signal 2, and their combination")
SecondarySIG = np.sin(KVar * X - AngularFrequency * T + Phase)
PrimarySIG = np.sin(KVar * X - AngularFrequency * T + Phase)
CUL = PrimarySIG + SecondarySIG
# Function responsible for drawing the actual graph on the canvas`enter code here`