微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

numpy中的错误:ufunc'multiply'不包含签名匹配类型的循环

如何解决numpy中的错误:ufunc'multiply'不包含签名匹配类型的循环

Error in Console

在控制台中出现错误

回溯(最近通话最近): 文件“ C:\ Users \ user \ PycharmProjects \ NAS2 \ main.py”,第29行,在 SecondarySIG [2] =(KVar * X-AngularFrequency * T + Phase) numpy.core._exceptions.UFuncTypeError:ufunc'multiply'不包含签名匹配类型为(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`

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。