<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # 單擺擺動周期的計算 相關文檔: [_單擺和雙擺模擬_](double_pendulum.html) 本程序利用odeint和fsolve計算單擺的擺動周期,并且和精確值進行比較。 ![](https://box.kancloud.cn/2016-03-19_56ed1bb89b52f.png) ``` # -*- coding: utf-8 -*- from math import sin, sqrt import numpy as np from scipy.integrate import odeint from scipy.optimize import fsolve import pylab as pl from scipy.special import ellipk g = 9.8 def pendulum_equations(w, t, l): th, v = w dth = v dv = - g/l * sin(th) return dth, dv def pendulum_th(t, l, th0): track = odeint(pendulum_equations, (th0, 0), [0, t], args=(l,)) return track[-1, 0] def pendulum_period(l, th0): t0 = 2*np.pi*sqrt( l/g ) / 4 t = fsolve( pendulum_th, t0, args = (l, th0) ) return t*4 ths = np.arange(0, np.pi/2.0, 0.01) periods = [pendulum_period(1, th) for th in ths] periods2 = 4*sqrt(1.0/g)*ellipk(np.sin(ths/2)**2) # 計算單擺周期的精確值 pl.plot(ths, periods, label = u"fsolve計算的單擺周期", linewidth=4.0) pl.plot(ths, periods2, "r", label = u"單擺周期精確值", linewidth=2.0) pl.legend(loc='upper left') pl.title(u"長度為1米單擺:初始擺角-擺動周期") pl.xlabel(u"初始擺角(弧度)") pl.ylabel(u"擺動周期(秒)") pl.show() ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看