%% Use MatLab to convert coupled Diff Eqs to a single Diff Eq
% This script requires the MatLab's symbolic toolbox

% Start by clearing everything
clear all
clc

%%
% Declare all symbolic variables
syms s m b k1 k2 Fa X Y

%%
% Solve equation for free body diagram at y
Y=solve('b*s*Y + k1*Y - b*s*X = 0',Y);

%%
% Substitute Y into free body equation at x
eq1=subs('m*s^2*X+b*s*X+k2*X-b*s*Y=Fa')

%% 
% Substitue for the value of Y
X=solve(eq1,X)

%% 
% Collect terms and simplify
collect(simple(X),s)
pretty(ans)