我正试图评估一个双重的整体,在这个整体上,内在组成部分的局限性是不同的,取决于外部整体。 从Matlab的背景来看,使用象征性的融合是容易的,但我不知道如何以高效的方式计算沙尔的同样情况。 页: 1 这种整体性的实例
非常赞赏在这方面的任何帮助。
最新消息:我正在寻找这一问题的数字解决办法。 非常感谢答案和帮助。 它们完全有意义。 我有一个最新的问题。 我想评估以下整体,即上述最新版本。 预示着很多事。
为了计算一个双重组成部分,您可使用以下功能:https://docs.scipy.org/doc/scipy/ reference/generated/scipy.integrate.dblquad.html“rel=“nofollow noreferer”>scipy.integrate.dblquad。 或您可使用scipy.integrate.quad 。 两次。
例子如下:
import math
from scipy.integrate import dblquad, quad
from scipy.special import erf, jv
def h(t, z):
return f(t) * g(z)
def f(t):
return 0.5 * t * (erf(t - a) - 1) * jv(0, q * t)
def g(z):
return math.exp(-((z - a) ** 2)/(2 * (s ** 2)))
def h1(z):
return integral_of_f(z) * g(z)
def h2(z):
return (integral_of_f(z) ** 2) * g(z)
def integral_of_f(z):
return quad(f, 0, 2 * z)[0] # here abserr is discarded
if __name__ == __main__ :
a, q, s = 0, 2, 3 # set the constants
result, abserr = dblquad(h, 0, 60, lambda z: 0, lambda z: 2 * z)
print(f result: {result}, abserr: {abserr} )
result1 = quad(h1, 0, 60)[0] # abserr here for result1 is not valid since abserr is already discarded in the function integral_of_f
print(f result1: {result1} )
result2 = quad(h2, 0, 60)[0] # abserr here for result2 is not valid too for the same reason
print(f result2: {result2} )
印刷
result: -0.21705286423629183, abserr: 1.4361242750875712e-08
result1: -0.21705286423678177
result2: 0.013105371081178754
您可以看到,通过使用<代码>dblquad<>/code>和result1
而计算出来的<代码>result是两倍的,因为其计算方法相同。
<代码>result2是关于最新问题的。
Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...
I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...
Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...
Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...
I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...
Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...
Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...
I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...