Code covered by the BSD License  

Highlights from
Bond graph add-on block library BG V.2.1

image thumbnail
from Bond graph add-on block library BG V.2.1 by Gert-Helge Geitner
Block library enables the graphical programming of Bond Graphs using standard Simulink and editor.

SpringCableCylinder_P
function SpringCableCylinder_P
%Parameter for SpringCableCylinder.pdf

assignin('base','m',4.5);        %mass [Kg]
assignin('base','R',0.12);       %radius [m]
assignin('base','Kc',1738);      %spring coefficient [N/m]
assignin('base','g',9.81);       %gravity [m/s^2]

evalin('base','J=(m*R^2)/2;');     %inertia [Kgm^2]

assignin('base','x_init',0.25);  %init cable lenght [m]
assignin('base','y_init',0.25);  %initial verticallocation of [m]
                                 %cylinder centre of mass
                                 
txt='"SpringCableCylinder"';
disp(['Parameter for Bond Graph example ' txt ' loaded!']);

Contact us at files@mathworks.com