Code covered by the BSD License  

Highlights from
Marine Automatics

image thumbnail

Marine Automatics

by

 

28 Oct 2010 (Updated )

Simulation models of marine automatics elements library for MATLAB/Simulink

Demo1c1.m
% Calculation of the positioner's parameters
% (C) Copyright by Mateusz Blonski, Szczecin 2010

% Get parameters of the actuator
parama=str2double(get_param('Demo1/Real RDPA(2)','MaskValues'));

% Calculate stiffness of the spring of the actuator
c=parama(1)*(parama(5)-parama(4))/parama(6);

% Get parameters of the positioner
paramp=str2double(get_param('Demo1/Pneumatic positioner','MaskValues'));

% Get parameters from the user
inp=inputdlg({'Type the air pressure value you want to apply to the positioner [Pa]:','Type the desired displacement value [m]:'},'Demo no. 1',1,{'90000','0.045+0.0025'});
pa=str2num(inp{1});
ygr=str2num(inp{2});

% Calculate parameters
div=(paramp(2)*pa)/(paramp(3)*ygr)-(1/(paramp(4)*(parama(1)/c)))

% Show message box
msgbox(['Feedback arm parameters ratio (a/b) is: ' num2str(div)],'Demo no. 1','help');

Contact us