ADDED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_rep.txt ================================================================== --- /dev/null +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_rep.txt @@ -0,0 +1,33 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system NonlinearMSD (NonlinearMSD_rep.txt) +## Generated by MTT on" Thu Mar 7 14:44:37 GMT 2002. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt NonlinearMSD abg tex # The system description +mtt NonlinearMSD sympar tex # The system parameters +## Uncomment the following lines or add others +## mtt NonlinearMSD dae tex # The system dae +mtt NonlinearMSD ode tex # The system ode +mtt NonlinearMSD sspar tex # Steady-state parameters +mtt NonlinearMSD ss tex # Steady state +## mtt NonlinearMSD dm tex # Descriptor matrices (of linearised system) +mtt NonlinearMSD sm tex # State matrices (of linearised system) +## mtt NonlinearMSD tf tex # Transfer function (of linearised system) +## mtt NonlinearMSD lmfr ps # log modulus of frequency response (of linearised system) +## mtt NonlinearMSD simpar tex # Simulation parameters +mtt NonlinearMSD numpar tex # Numerical simulation parameters +mtt NonlinearMSD state tex # Simulation initial state +mtt NonlinearMSD input tex # Simulation input +## mtt NonlinearMSD logic tex # Logic control +mtt NonlinearMSD odeso ps # Simulation output + +## mtt NonlinearMSD rep txt # This file ADDED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_sspar.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_sspar.r ================================================================== --- /dev/null +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_sspar.r @@ -0,0 +1,25 @@ +% Steady-state parameter file (NonlinearMSD_sspar.r) +% Generated by MTT at Thu Mar 7 10:39:15 GMT 2002 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 2000/12/28 09:32:04 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%% This one corresponds to the unstretched spring at theta = pi/3 +%% Note that U is calculated to give equilibrium for all angles + +alpha := pi/3; + +% Steady-state states +MTTX1 := eta; %Initial angle (corresponds to u=0) +MTTX2 := 0; %Initial anglular velocity +% Steady-state inputs +MTTU1 := k*(l^2)*cos(MTTX1/2)*2*(sin(MTTX1/2)-sin(alpha/2)); +;;END; ADDED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_state.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_state.txt ================================================================== --- /dev/null +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_state.txt @@ -0,0 +1,11 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System NonlinearMSD, representation state, language txt; +## File NonlinearMSD_state.txt; +## Generated by MTT on Thu Mar 7 10:50:45 GMT 2002; + + + +NonlinearMSD_j = 0.0; % Initial angular momentum +NonlinearMSD_k = eta; % Initial angle ADDED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/plot_k.m Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/plot_k.m ================================================================== --- /dev/null +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/plot_k.m @@ -0,0 +1,18 @@ +## Plots the effective spring constant. + +p = NonlinearMSD_numpar; # Numerical parameters +s = NonlinearMSD_sympar # Symbolic parameters + +Eta = eta=[0:0.01:1]*pi; K = []; +for eta=Eta + p(s.eta) = eta; # Change the eta parameter + A = NonlinearMSD_sm(p); # SS A matrix + k = -A(2,1); + K = [K k]; +endfor + +grid; +ylabel("k"); +xlabel("eta"); +plot(Eta,K); +figfig("k","eps");