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.

SMdq2_skalar_P
function SMdq2_skalar_P
%function SMdq2_skalar_P
%Lsd - Stnderinduktivitt Lngsachse / stator inductance d-axis    // [H]
%Lsq - Stnderinduktivitt Querachse  / stator inductance q-axis    // [H]
%Lf  - Erregerinduktivitt            / field inductance            // [H]
%LM  - Koppelinduktivitt             / mutual inductance           // [H]
%Rs  - Stnderwiderstand              / stator resistance           // [Ohm]
%Rf  - Erregerwiderstand              / field resistance            // [Ohm]
%ns  - Windungszahl Stnderwicklung   / number of stator turns      // [-]
%nf  - Windungszahl Erregerwicklung   / number of field turns       // [-]
%zp  - Polpaaranzahl                  / pole pair number            // [-]
%JM  - Trgheitsmoment Motor          / inertia torque motor side   //[Kgm^2/rad]
%Kd  - Omega-proportionale Reibung    / omega proportional friction //[Nms/rad]


assignin('base','Lsd',0.00986); % [H]
assignin('base','Lsq',0.01049); % [H]
assignin('base','Lf',0.0167);   % [H]
assignin('base','LM',0.00921);  % [H]
assignin('base','Rs',0.452);    % [Ohm]
assignin('base','Rf',0.545);    % [Ohm]
assignin('base','ns',1000);     % [-]
assignin('base','nf',1000);     % [-]
assignin('base','zp',3);        % [-]
assignin('base','JM',0.04);     % [Kgm^2/rad]
assignin('base','Kd',0.2);      % [Nms/rad]

%------------------------------- MATLAB workspace ----------------------------%
%Ohne Dmpferwicklung / without damper winding: M1 - Sahm; M2 - Morel
evalin('base','M1=[ Lf      -LM       ; -LM       Lsd     ]/(Lsd*Lf-LM^2);');
evalin('base','M2=[ Lf*ns^2 -LM*ns*nf ; -LM*ns*nf Lsd*nf^2]/(Lsd*Lf-LM^2);'); 

txt1='Parameter fr Bondgraph SM Beispiel 2 skalar geladen!';
txt2='Parameter loaded - bond graph example 2 SMdq scalar';
disp([txt1 sprintf('\n') txt2]);

Contact us at files@mathworks.com