% ----------------------------------------------------------------------- %
%  DDDD        FFFFF        L     L
%  D   D       F      aaa   L     L
%  D   D  ---  FFFF  a   a  L     L
%  D   D       F     a  aa  L     L
%  DDDD        F      aa a  LLLL  LLLL
% ----------------------------------------------------------------------- %

% DESCRIPTION:
% Paramter matlab script for the Simulink introduction tutorial that
% simulates a pendulum.

%% Clear the "Workspace"
clear;

%% Specify the parameters
% Specify the mass of the pendulum, in units of [kilograms]
m = 1.5;
% Specify the length of the pendulum, in units of [meters]
l = 0.8;
% Specify the acceleration due to gravity, in units of [m/s^2]
g = 9.81;
% Specify the angular kinetic friction constant of proportionality,
% in units of [Nms/radian]
c = 0.5;
% Specify the initial angle of the pendulum, in units of [radians]
initial_theta = 60 * (pi / 180);

%% Display things to the user
disp( '----------------------------------------------------------------' );
disp( 'RUNNING THE "simulink_intro_pendulum_parameters.m" SCRIPT' );
disp( ' ' );
disp( 'The workspace variables have being set to the following values:' );
disp(['>  m  =  ',num2str(m,'%.2f'),', mass in [kg]' ]);
disp(['>  l  =  ',num2str(l,'%.2f'),', length in [m]' ]);
disp(['>  g  =  ',num2str(g,'%.2f'),', length in [m/s^2]' ]);
disp(['>  c  =  ',num2str(c,'%.2f'),', friction coefficient in [Nms/radian]' ]);
disp(['>  initial_theta  =  ',num2str(initial_theta,'%.2f'),', [radians]' ]);
disp(['>                 =  ',num2str(initial_theta*180/pi,'%.2f'),', [degrees]' ]);
disp( ' ' );
disp( '----------------------------------------------------------------' );
disp( ' ' );