switching.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:Auspex 作者: BBN-Q 项目源码 文件源码
def perp_fit(ts, vs):

    def lsq_macrospin(p, ts, vs):
        t0 = p[0]
        v0 = p[1]
        a = v0
        b = t0*v0
        to = 1
        vo = a + b/to

        # Here is what we expect
        vs_ideal = v0*(1.0 + t0/ts)
        Xs = []
        Ys = []
        for t,v in zip(ts,vs):
            ti,vi = find_closest(t,v,t0,v0)
            Xs.append(x2X(ti,to,b))
            Ys.append(y2Y(v,vi,a,b))
        return np.power(Ys,2)
    p0 = [0.2, 100]
    p, flag = leastsq(lsq_macrospin, p0, args=(ts, vs))
    return p
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号