Python:绘制积分函数

2024-10-01 11:21:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我看到这里有一些类似的问题,但似乎没有一个能真正解决我的问题。 这是我的密码:

import numpy as np
from matplotlib import pyplot as mp
from scipy.integrate import * 

deltat = 30.0e-6
ku = 50.0e-12
pant = 0.05
csc = 200.0e-12
tausc = 150.0e-6

def int1(tp, tausc, csc, t):
    return (1/csc)*(np.exp(-tp/tausc))

def deltafisc(t):
    return quad(int1, 0, np.inf, args=(tausc, csc, t))

t = np.linspace(-2.0, 2.0, num=100)*1e-4

mp.plot(t,deltafisc(t))
mp.show()

这个函数可以工作,但是当我试图绘制它时,会报告一个错误。你知道吗


Tags: fromimportnumpy密码returnmatplotlibdefas