You will notice from the sample models in later sections that the most important step for modeling is to figure out 'Governing Equation' for the system.
Then you may ask "How can I get the governing equation for the system ?".
The simplest answer would be "use your common sense or intuition and try to make your own question about the system".
For example, let's suppose that you have a mass tied to the end of a spring in vertical direction and pulled the mass down and released it.
Possible questions for this case would be
- Where the mass will be at 2 seconds from now ?
- What would be the speed of the mass at 2 seconds from now ?
This is a good starting point, but these question by themselves does not generate the governing equations. You need some formal knowledge to figure out the governing equation that will give you the answers to your questions.
- What rules lead to a governing equation for a mechanical system ?
- What rules lead to a governing equation for an electrical system ?
- How do the rules turn the spring-mass question into an equation ?
What rules lead to a governing equation for a mechanical system ?
There are several useful rules that can lead you to a geverning equation. In case of mechanical system/dynamic system (system dealing with moving object), followings can be the most frequently used rules. Don't try just blindly memorize these rules and it would not help much. Just try to understand the meaning of these rules.
I would not explain any further about these equation. Try yourself to find materials from internet or text book. Try reading different sources as diverse as possible. Everybody would give you a little bit different aspect and insight. As you read through those sources, your brain would reorgnaize it by itself and you will get your own understanding of these rules.
If you have solid understanding of these rules, you would be able to follow through the example models in this post without any difficulties.
The diagram below pairs each of four rules with the equation that states it. Newton's law and Hooke's law are force laws, so you write them for one body at a time. The Lagrangian and the Hamiltonian are energy methods. With them, you write one energy function for the whole system and differentiate it.

Newton's law turns a force balance into a second order equation : the net force F on a body equals its mass m times its acceleration a. Acceleration is the second derivative of position, a = d2x/dt2. So every force balance you write with this law becomes a differential equation in x.Hooke's law gives the spring force : a spring pushes back with a force proportional to its stretch x, and k is the spring constant. The picture spells it Hook's Law and writes the size of the force, F = kx. In a force balance the spring force points against the stretch, so it enters the equation as -kx.The Lagrangian gives the motion from energy alone : L is the kinetic energy minus the potential energy, written in a coordinate θ and its rate ω = dθ/dt. The equation in the picture is the Euler-Lagrange equation. It gives the equation of motion for θ without any force arrows, which helps most when the coordinate is an angle, as in a pendulum.The Hamiltonian is a pair of first order equations : H is the total energy, written in a coordinate q and its momentum p. Hamilton's equations are dq/dt = ∂H/∂p and dp/dt = -∂H/∂q. The picture shows only the first of the pair, with x as the coordinate and θ standing for its momentum.
In practice, you try these rules in the order of the list. Newton's law with Hooke's law covers most single-body problems. You reach for an energy method when the forces are hard to draw. One example is a rod or a track that holds the body on a curved path.
Start with a force balance : for one moving body, Newton's law plus the force laws of its parts gives the governing equation directly.Use energy when the forces are unclear : the Lagrangian needs only the kinetic and potential energy, so the constraint forces never appear.Watch the sign of a restoring force : the formulas in the picture give sizes, and you supply the direction when you build the equation.
What rules lead to a governing equation for an electrical system ?
If you are dealing with any electrical/ectronic system, following rules can be a good source that lead you to a proper governing equation. Both laws are conservation rules. Charge cannot pile up at a node, and the voltage around a closed loop must come back to its starting value.
The diagram below shows a battery, a lamp and a switch wired into one loop, with the circuit symbol of the same loop beside them. The two Kirchhoff laws on the right are the rules that turn such a circuit into equations.

Kirchhoff's Current Law is written at a node : the currents Ik flowing into one node add up to zero, with a current flowing out counted as negative.Kirchhoff's Voltage Law is written around a loop : the voltages Vk across the parts of one closed loop add up to zero, with a voltage drop and a voltage rise taking opposite signs.The derivative comes from the parts, not from the laws : a resistor gives v = Ri, a capacitor gives i = C dv/dt and an inductor gives v = L di/dt. Kirchhoff's laws alone give algebraic equations. A capacitor or an inductor in the loop is what makes the result a differential equation.
Let's see this in a series loop of a DC source Vs, a resistor R and a capacitor C. KVL around the loop gives Vs - Ri - vC = 0. The same current i flows through the capacitor, so i = C dvC/dt. Substituting it gives the governing equation RC dvC/dt + vC = Vs.
With the capacitor empty at t = 0, the solution is vC(t) = Vs(1 - e-t/RC). For example, take Vs = 5 V, R = 1 kΩ and C = 1 mF, so RC = 1 s. The capacitor voltage is then 3.16 V at t = 1 s and 4.97 V at t = 5 s. The product RC is the time constant, and it sets how fast the loop settles.
KCL and KVL play the role of Newton's law : they state the balance, and the component laws supply the terms inside it.Each capacitor or inductor adds one order : one storage element gives a first order equation, and an RLC loop gives a second order one.
You can find more circuits built this way on the Electric Circuit modeling page.
How do the rules turn the spring-mass question into an equation ?
Let's go back to the mass on the spring from the top of this page and answer its two questions. The work runs in three steps. You choose a coordinate, you write every force in that coordinate, and then you apply Newton's law.
Let x be the position of the mass, measured downward from its resting position. At rest, the spring is already stretched by δ, and its force balances gravity, so kδ = mg. When the mass sits at x, the spring stretch is x + δ. Gravity pulls the mass down with mg, and the spring pulls it up with k(x + δ).
Newton's law then gives m d2x/dt2 = mg - k(x + δ). The terms mg and kδ cancel, so the governing equation is m d2x/dt2 = -kx. This equation says the acceleration always points back to the resting position, and it grows with the distance from it. Its solution is an oscillation with angular frequency ω = √(k/m).
Now let's put numbers in. Take m = 0.5 kg and k = 50 N/m, pull the mass 0.1 m down and release it from rest. Then ω = 10 rad/s, and one period is 2π/ω = 0.628 s. The position is x(t) = 0.1 cos(10t) m, and the velocity is v(t) = -sin(10t) m/s.
At t = 2 s, the argument 10t is 20 rad. The position is x = 0.1 cos(20) = 0.041 m, so the mass is 4.1 cm below its resting position. The velocity is v = -sin(20) = -0.913 m/s. The minus sign means the mass is moving upward at 0.913 m/s. Note that the static stretch δ = mg/k = 0.098 m never appears in either answer.
Measure from the resting position : gravity and the static spring force cancel there, so the equation keeps only the -kx term.Your questions pick the unknown : asking where the mass is and how fast it moves makes x(t) the unknown, and its derivative gives the speed.This model has no loss : the oscillation never decays. A real spring needs a damping term, which the Spring Mass Model page adds.