⇠ Back to the gallery

Simple accelerating point mass

Example of a simple accelerating point mass in codyn. The model on the left shows how a second order system can be implemented by explicit modeling of a pair of first order equations.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Initial position of the point mass
y = 10

# Gravity
g = 9.81

# Mass
m = 0.6

# External force
f = 0

# Acceleration
y'' = "-g + f / m"

⌦ Open in playground