由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Mathematics版 - solve integral eq. embeeded with another integral eq. (转载)
相关主题
能问个基本的1st order PDE问题不?请问关于一个分部积分的问题 (转载)
solve an optimization model with integral as constraints (转载)招聘:Junior Quantitative Developer-Trading firm-芝加哥
请问应该如何逐级展开解这个微分方程?芝加哥Trading frim招:Quantitative Developer
请教一个数值问题,请帮助着急问,明天在做PRESENTATION
a questionRe: Need help to solve DE.
integral****Help Needed, thanks****
50个包子请教 Chebyshev's integral inequalityHelp with this nonlinear equation system!! Waiting online.
问一个实变问题Help, please...Please....defferential eq.
相关话题的讨论汇总
话题: integral话题: sol话题: print话题: import
进入Mathematics版参与讨论
1 (共1页)
m******t
发帖数: 273
1
【 以下文字转载自 Quant 讨论区 】
发信人: myregmit (myregmit), 信区: Quant
标 题: solve integral eq. embeeded with another integral eq.
发信站: BBS 未名空间站 (Sun Mar 23 14:20:18 2014, 美东)
I need to solve an integral equation embedded with another integral equation
by python 3.2 in win7.
There are 2 integral equations.
The code is here:
import numpy as np
from scipy.optimize.minpack import fsolve
from numpy import exp
from scipy.integrate.quadpack import quad
import matplotlib.pyplot as plt
import sympy as syp
lb = 0
def integrand2(x, a):
print("integrand2 called")
return x**(a-1) * exp(-x)
def integrand1(x, b, c):
print("integrand1 called")
integral , err = quad(integrand2, lb/b, syp.oo , args=(1+c))
return c/(b*integral)
def intergralFunc1(b,c):
integral,err = quad(integrand1, 0, 10, args=(b,c))
print("integral is ", integral, " and err is ", err)
print("b is ", b, " and c is ", c)
return 10 - integral

def findGuess():
vfunc = np.vectorize(intergralFunc1)
f1 = np.linspace(0.01, 10,10)
f2 = np.linspace(0.01, 10,10)
result = vfunc(f1, f2)
plt.plot(f1, result)
plt.xlabel('f1')
plt.subplot(211)

plt.plot(f2, result)
plt.xlabel('f2')
plt.subplot(212)
plt.show()
def solveFunction():
sol= fsolve(intergralFunc1, 5, 5, full_output=True)
return sol
if __name__ == '__main__':
findGuess()

sol = solveFunction()
print("sol is ", sol)
print("verification: n")
print("f(b,c) is ", intergralFunc1(sol[0],5))

I got the results that make no sense.
integral is nan and err is nan
b is [ 5.] and c is 5
f(b,c) is nan
Any help would be appreciated !!!
1 (共1页)
进入Mathematics版参与讨论
相关主题
Help, please...Please....defferential eq.a question
how to solve this equation?integral
how to solve complex root?50个包子请教 Chebyshev's integral inequality
help to solve a wave equation, thx问一个实变问题
能问个基本的1st order PDE问题不?请问关于一个分部积分的问题 (转载)
solve an optimization model with integral as constraints (转载)招聘:Junior Quantitative Developer-Trading firm-芝加哥
请问应该如何逐级展开解这个微分方程?芝加哥Trading frim招:Quantitative Developer
请教一个数值问题,请帮助着急问,明天在做PRESENTATION
相关话题的讨论汇总
话题: integral话题: sol话题: print话题: import