function I = internal_energy_two_springs (q)
% internal energy of two springs in serial
    global k1;
    global k2;
    global fext;
    
    x1 = q(1);
    x2 = q(2);
    
    U = (1/2)*k1*x1^2 + (1/2)*k2*(x2-x1)^2;
    W = fext*x2;
    I = U - W;
end
