Create a simple system

Before starting, make sure you understand the basic Drake concept at this link.

Drake Concepts

Goal

Given a Equation of Motion (EoM) of a particle mass system, create the exact system which moves with external force. Simulate the system and visualize the results.

Analysis

A non-linear system has EoM like this:

x˙=f(t,x,u)y=g(t,x,u)\dot{x} = f(t,x,u) \\ y = g(t,x,u)

Say in our example, the system has EoM like this:

x¨=f(t)/my(t)=x(t)where,x(t)=[x,x˙]\ddot{x} = f(t)/m \\ y(t) = x(t) \\ where, x(t) = [x, \dot{x}]'

The system get external force f(t)f(t) from input port, then we compute the system state and write the result observation y(t)y(t) to output port.

The f(t)f(t) comes from a input source, the output of the system goes to the visualization so we could observe the result.

Code Implementation

Create the system

Build the diagram

Credit

Thanks Manuel Ahumada for providing this example.

Last updated

Was this helpful?