9
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

単振動とバネ

Last updated at Posted at 2015-03-26

単振動に必要な要素は以下。

k  = 0.1;
x  = 0;
px = x;
ax = 0;
vx = 0;

k はばね定数。
ばねの強さを表し、値が大きいと固いばねになる。

以下のように動かす。

ax = (px - x) * k;
vx += ax;
x  += vx;

抗力(cd)がないと単振動になる。
抗力を加えると、ばねになる。

cd = 0.2;
k  = 0.1;
x  = 0;
px = x;
ax = 0;
vx = 0;

以下のように動かす。

ax = (px - x) * k;
ax -= cd * vx;
vx += ax;
x  += vx;

応用すると以下のような動きが表現できる。

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?