Skip to content

Commit 2c17387

Browse files
committed
final cleanup
1 parent 9592114 commit 2c17387

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

Controls/Declutching/optimalTimeCalc.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
grid on
6262
xline(resonantFreq/(2*pi))
6363
xline(1/T,'--')
64-
legend('','resonant Frequency','Wave Frequency','Location','southwest')
64+
legend('','Resonant Frequency','Wave Frequency','Location','southwest')
6565

6666
subplot(2,1,2)
6767
semilogx((hydro.simulation_parameters.w_extended)/(2*pi),Phase)
@@ -70,7 +70,7 @@
7070
grid on
7171
xline(resonantFreq/(2*pi))
7272
xline(1/T,'--')
73-
legend('','resonant Frequency','Wave Frequency','Location','northwest')
73+
legend('','Resonant Frequency','Wave Frequency','Location','northwest')
7474

7575
% Determine optimal latching time
7676
optDeclutchTime = 0.5*(resonantPeriod - T)

Controls/Latching/optimalTimeCalc.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
grid on
6363
xline(resonantFreq/(2*pi))
6464
xline(1/T,'--')
65-
legend('','resonant Frequency','Wave Frequency','Location','southwest')
65+
legend('','Resonant Frequency','Wave Frequency','Location','southwest')
6666

6767
subplot(2,1,2)
6868
semilogx((hydro.simulation_parameters.w_extended)/(2*pi),Phase)
@@ -71,7 +71,7 @@
7171
grid on
7272
xline(resonantFreq/(2*pi))
7373
xline(1/T,'--')
74-
legend('','resonant Frequency','Wave Frequency','Location','northwest')
74+
legend('','Resonant Frequency','Wave Frequency','Location','northwest')
7575

7676
% Determine optimal latching time
7777
optLatchTime = 0.5*(T - resonantPeriod)

Controls/Passive (P)/optimalGainCalc.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
mass = simu.rho * hydro.properties.volume;
3737
addedMass = squeeze(hydro.hydro_coeffs.added_mass.all(dof, dof, :)) * simu.rho;
3838
addedMass = interp1(hydro.simulation_parameters.w, addedMass, hydro.simulation_parameters.w_extended, 'spline', 'extrap')';
39+
addedMass = squeeze(hydro.hydro_coeffs.added_mass.inf_freq(dof, dof, :)) * simu.rho;
3940

4041
radiationDamping = squeeze(hydro.hydro_coeffs.radiation_damping.all(dof,dof,:)).*squeeze(hydro.simulation_parameters.w')*simu.rho;
4142
radiationDamping = interp1(hydro.simulation_parameters.w, radiationDamping, hydro.simulation_parameters.w_extended, 'spline', 'extrap')';
@@ -77,7 +78,7 @@
7778
fprintf('Maximum potential power P_max = %f\n', P_max);
7879

7980
% Optimal proportional gain for passive control:
80-
KpOpt = sqrt(radiationDamping(omegaIndex)^2 + ((hydrostaticStiffness/omega) - omega*(mass + addedMass(omegaIndex)))^2);
81+
KpOpt = sqrt(radiationDamping(omegaIndex)^2 + ((hydrostaticStiffness/omega) - omega*(mass + addedMass))^2);
8182
Ki = 0;
8283
fprintf('Optimal proportional gain for passive control KpOpt = %f\n', KpOpt);
8384

Controls/Passive (P)/userDefinedFunctionsMCR.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
mcr.maxPower(imcr) = max(controllersOutput.power(startInd:endInd,3));
1818
mcr.maxForce(imcr) = max(controllersOutput.force(startInd:endInd,3));
1919

20-
if imcr == 9
20+
if imcr == length(mcr.cases)
2121
figure()
2222
plot(mcr.cases,mcr.meanPower)
2323
title('Mean Power vs. Proportional Gain')

Controls/Reactive (PI)/optimalGainCalc.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
grid on
6262
xline(resonantFreq/(2*pi))
6363
xline(1/T,'--')
64-
legend('','resonant Frequency','Wave Frequency','Location','southwest','interpreter','latex')
64+
legend('','Resonant Frequency','Wave Frequency','Location','southwest','interpreter','latex')
6565

6666
subplot(2,1,2)
6767
semilogx((hydro.simulation_parameters.w_extended)/(2*pi),Phase)
@@ -70,7 +70,7 @@
7070
grid on
7171
xline(resonantFreq/(2*pi))
7272
xline(1/T,'--')
73-
legend('','resonant Frequency','Wave Frequency','Location','northwest','interpreter','latex')
73+
legend('','Resonant Frequency','Wave Frequency','Location','northwest','interpreter','latex')
7474

7575
% Calculate the maximum potential power
7676
P_max = -sum(abs(Fexc).^2./(8*real(Zi)));

Controls/Reactive (PI)/userDefinedFunctionsMCR.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
mcr.maxPower(imcr) = max(controllersOutput.power(startInd:endInd,3));
1818
mcr.maxForce(imcr) = max(controllersOutput.force(startInd:endInd,3));
1919

20-
if imcr == 81
20+
if imcr == length(mcr.cases)
2121

2222
% Kp and Ki gains
2323
kps = unique(mcr.cases(:,1));

0 commit comments

Comments
 (0)