正文
方便计算,这里让\(\omega_0=1\)
便于理解,\(x=\theta,y=\dot{x}=\omega\)
于是
\(\frac{dx}{dt}=y\\\frac{dy}{dt}=-\sin(x)\)
Vector field里面写这个
// p.x and p.y are current coordinates
// v.x and v.y is a velocity at point p
vec2 get_velocity(vec2 p) {
vec2 v = vec2(0., 0.);
// change this to get a new vector field
v.x = p.y;
v.y =sin(p.x);
return v;
}
录了个视频
参考
one minor hiccup
v.y =sin(p.x);
这里正负号打反了,将就着看吧。相位差了\(\pi\)
原文:https://www.cnblogs.com/yhm138/p/14257879.html