% m-file to generate the Force-Velocity curve for the DTS2500KN system
% there are options to use 1 or 2 servovalves/actuator and 1 or 2 actuators
% together

% maximum force of 1 actuator is considered to be 2200 KN at 280 Bar or
% 4000 psi

MaxRunPressure = 230    % System Pressure at end of test

MaxStaticForce = 2200
MaxForce = MaxStaticForce * MaxRunPressure / 280    % max force at end system pressure

% I have to do conversion to inches/sec velocity and then figure out how
% many meters per sec.
MaxSVDeltaP=MaxRunPressure
MaxSVFlow=1000*sqrt(230/70)     % in liters/min
MaxSVFGPM=MaxSVFlow/3.7854      % in gallons/min
MaxSVFCIS=MaxSVFGPM*3.85        % in cubic-inches/sec

MaxStaticFLbs = MaxStaticForce * 224.8089   % max force in lbs
PistonArea = MaxStaticFLbs/4000             % piston area in in^2

MaxVel = MaxSVFCIS/PistonArea/39.34         % in meters/sec

% these #s are good for 1 actuator and 1 servovalve

MaxStaticVel = 0.4      % for 1 actuator (plot scaling only)

NValve = 2
NActuator = 2

FMax = NActuator * MaxForce
VMax = NValve * MaxVel
YMaxScale = MaxStaticForce * NActuator
XMaxScale = MaxStaticVel * NValve

vel = 0.0
deltav = 0.01
for i = 1:101,
    f(i,1) = FMax * (1.0 - (vel)^2)
    v(i,1) = VMax * vel
    vel = vel + deltav
end;
plot(v(:,1),f(:,1))
axis([ 0 XMaxScale 0 YMaxScale])
MaxPStr = num2str(MaxRunPressure)
maintitle=strcat('DTS2500 Force-Velocity Curve -',MaxPStr,' bar')
title(maintitle)
ylabel('Force (KN)')
xlabel('Velocity (M/Sec)')
grid on

