重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

Gauss-LegendreintegrationinPython的代码

代码闲暇时间,将代码过程重要的一些代码收藏起来,下面代码是关于Gauss-Legendre integration in Python的代码,希望对小伙伴也有用处。

站在用户的角度思考问题,与客户深入沟通,找到芒市网站设计与芒市网站推广的解决方案,凭借多年的经验,让设计与互联网技术结合,创造个性化、用户体验好的作品,建站类型包括:成都网站制作、网站设计、企业官网、英文网站、手机端网站、网站推广、主机域名雅安服务器托管、企业邮箱。业务覆盖芒市地区。

''' I = gaussQuad2(f,xc,yc,m).
    Gauss-Legendre integration of f(x,y) over a
    quadrilateral using integration order m.
    {xc},{yc} are the corner coordinates of the quadrilateral.
'''
from numpy import zeros,dot

def gaussQuad2(f,x,y,m):

    def jac(x,y,s,t):
        J = zeros((2,2))

    def map(x,y,s,t):
        N = zeros(4)
        xCoord = dot(N,x)
        yCoord = dot(N,y)
        return xCoord,yCoord

    s,A = gaussNodes(m)
    sum = 0.0
    for i in range(m):
        for j in range(m):
            xCoord,yCoord = map(x,y,s[i],s[j])
    return sum

当前标题:Gauss-LegendreintegrationinPython的代码
文章转载:http://cqcxhl.cn/article/pohics.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP