File:Inverted pendulum oscillatory base.svg

原始文件(SVG文件,尺寸为1,070 × 431像素,文件大小:60 KB)


摘要

描述
English: Plots illustrating the behaviour of an inverted pendulum mounted on an oscillatory base. The first plot shows the response of the pendulum on a slow oscillation (), the second the response on a fast oscillation ().

The motion of the pendulum is given by the the following differential equation

日期
来源 自己的作品
作者 Nicoguaro
SVG开发
InfoField
 
SVG的源代码为有效代码
 
矢量图使用Matplotlib创作。
源代码
InfoField

Python code

from __future__ import division
import numpy as np
from numpy import sin, cos, pi
from scipy.integrate import odeint
import matplotlib.pyplot as plt
from matplotlib import rcParams

rcParams['font.size'] = 14
rcParams['legend.handlelength'] = 0

def pend(x, t, grav=9.81, length=1, amplitude=0.05, omega=10):
    theta, dtheta = x
    dxdt = [dtheta,
            sin(theta)/length*(grav - amplitude*omega**2 * sin(omega*t))]
    return dxdt

plt.figure(figsize=(14, 5))
plt.subplot(121)
time = np.linspace(0, 1.5, 101)
sol = odeint(pend, [0.1, 0], time, args=(9.81, 1, 0.05, 10))
theta, _ = sol.T
plt.plot(time, theta*180/pi, color="#e41a1c", lw=2)
plt.xlim(0, 1.5)
plt.ylim(0, 100)
plt.xlabel(r"$t$ (s)")
plt.ylabel(r"$\theta$ (deg)")
plt.legend([r"$\omega=10$"], numpoints=1, framealpha=0)

plt.subplot(122)
time = np.linspace(0, 3, 1001)
sol = odeint(pend, [0.05, 0], time, args=(9.81, 1, 0.05, 200))
theta, omega = sol.T
plt.plot(time, theta*180/pi, color="#e41a1c", lw=2)
plt.xlim(0, 2.5)
plt.xlabel(r"$t$ (s)")
plt.ylabel(r"$\theta$ (deg)")
plt.legend([r"$\omega=200$"], numpoints=1, framealpha=0)

plt.savefig("inverted_pendulum_oscillatory_base.svg", bbox_inches="tight")
plt.show()

许可协议

我,本作品著作权人,特此采用以下许可协议发表本作品:
w:zh:知识共享
署名
本文件采用知识共享署名 4.0 国际许可协议授权。
您可以自由地:
  • 共享 – 复制、发行并传播本作品
  • 修改 – 改编作品
惟须遵守下列条件:
  • 署名 – 您必须对作品进行署名,提供授权条款的链接,并说明是否对原始内容进行了更改。您可以用任何合理的方式来署名,但不得以任何方式表明许可人认可您或您的使用。

说明

添加一行文字以描述该文件所表现的内容

此文件中描述的项目

描繪內容

文件历史

点击某个日期/时间查看对应时刻的文件。

日期/时间缩⁠略⁠图大小用户备注
当前2016年7月5日 (二) 04:532016年7月5日 (二) 04:53版本的缩略图1,070 × 431(60 KB)NicoguaroUser created page with UploadWizard

以下页面使用本文件:

全域文件用途

以下其他wiki使用此文件:

元数据