sim_onepend.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Non-Linear Vibrations %
% %
% Script for simulating simple pendulum in %
% 'onepend.mdl' Simulink model. %
% Created on 03/10/2000 by Douglas E. Adams %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create simulation parameters
dt=0.01;
Nt=2^15;
T=(0:dt:(Nt-1)*dt)';
% Create system parameters
m=1; c=0.1; k=10; k_n=100; F_o=10;
mu1=0; % Coefficient of 'sin' function
mu2=1; % Coefficient of 'theta^3' function
% Simulate for certain initial conditions and excitation
% and then plot results
x_0=.01; xd_0=0; % ICs #1
U=F_o*cos(7.488*T);
sim('onepend');
plot(T,t1l,T,t1); % Blue - 't1l' is the linear response; Red - 't1' is nonlinear response