|
|
|
|
%% Plot Bahn mit unterschiedlichen Gewichten
|
|
|
|
|
% W<EFBFBD>hrend eines Breakpoints in BerechneSpline_Rotor ausf<EFBFBD>hren, damit die
|
|
|
|
|
% entsprechend Daten alle da sind.
|
|
|
|
|
clear all
|
|
|
|
|
|
|
|
|
|
%% Skript f<EFBFBD>r Plotbasics
|
|
|
|
|
basics_plot
|
|
|
|
|
|
|
|
|
|
%% Beginn
|
|
|
|
|
|
|
|
|
|
close all
|
|
|
|
|
|
|
|
|
|
alphaDeg = 50:1:180;
|
|
|
|
|
alpha = alphaDeg.*pi/180;
|
|
|
|
|
|
|
|
|
|
r = [cos(alpha);sin(alpha)];
|
|
|
|
|
|
|
|
|
|
r = r(2,:)+1;
|
|
|
|
|
|
|
|
|
|
plot(alphaDeg,r,'Color',myLineOne)
|
|
|
|
|
|
|
|
|
|
set(gcf,'defaulttextinterpreter','none')
|
|
|
|
|
|
|
|
|
|
hold on
|
|
|
|
|
|
|
|
|
|
plot([min(alphaDeg) min(alphaDeg)],[min(r) max(r)],'LineStyle','--','Color',myGray50)
|
|
|
|
|
plot([max(alphaDeg) max(alphaDeg)],[min(r) max(r)],'LineStyle','--','Color',myGray50)
|
|
|
|
|
|
|
|
|
|
text(min(alphaDeg)-0.1,1.3,['Infeasible', char(10), 'Region'],'Rotation',90,'VerticalAlignment','bottom')
|
|
|
|
|
|
|
|
|
|
text(max(alphaDeg)+0.1,1.3,['Infeasible', char(10), 'Region'],'Rotation',90,'VerticalAlignment','top')
|
|
|
|
|
|
|
|
|
|
plot([alphaDeg(end)],[r(end)],'Marker','o','LineStyle','none','Color',myLineThree)
|
|
|
|
|
plot([alphaDeg(1)],[r(1)],'Marker','o','LineStyle','none','Color',myLineTwo)
|
|
|
|
|
|
|
|
|
|
plot([alphaDeg(end),alphaDeg(end)+5],[r(end),r(end)+0.12],'Color',myGray25)
|
|
|
|
|
text(alphaDeg(end)+2,r(end)+0.17,['Global', char(10), 'Minimum'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
text(alphaDeg(1)+0.02,r(1)-0.07,['Local', char(10), 'Minimum'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
box off
|
|
|
|
|
|
|
|
|
|
set(gca,'XLim',[0,360])
|
|
|
|
|
try
|
|
|
|
|
|
|
|
|
|
for i = 0:5
|
|
|
|
|
switch i
|
|
|
|
|
case 0
|
|
|
|
|
|
|
|
|
|
plot([i*60,i*60+6],[min(r),min(r)+0.12],'Color',myGray25)
|
|
|
|
|
text(i*60,min(r)+0.14,['$\alpha_{\text{init},',num2str(i),'}$'],'HorizontalAlignment','left')
|
|
|
|
|
case 1
|
|
|
|
|
plot([i*60,i*60],[min(r),min(r)+0.06],'Color',myGray25)
|
|
|
|
|
text(i*60,min(r)+0.08,['$\alpha_{\text{init},',num2str(i),'}$'],'HorizontalAlignment','center')
|
|
|
|
|
case 2
|
|
|
|
|
plot([i*60,i*60],[min(r),min(r)+0.06],'Color',myGray25)
|
|
|
|
|
text(i*60,min(r)+0.08,['$\alpha_{\text{init},',num2str(i),'}$'],'HorizontalAlignment','center')
|
|
|
|
|
case 3
|
|
|
|
|
plot([i*60,i*60-20],[min(r),min(r)+0.12],'Color',myGray25)
|
|
|
|
|
text(i*60-14,min(r)+0.14,['$\alpha_{\text{init},',num2str(i),'}$'],'HorizontalAlignment','right')
|
|
|
|
|
case 4
|
|
|
|
|
plot([i*60,i*60+20],[min(r),min(r)+0.12],'Color',myGray25)
|
|
|
|
|
text(i*60+14,min(r)+0.14,['$\alpha_{\text{init},',num2str(i),'}$'],'HorizontalAlignment','left')
|
|
|
|
|
case 5
|
|
|
|
|
plot([i*60,i*60],[min(r),min(r)+0.06],'Color',myGray25)
|
|
|
|
|
text(i*60,min(r)+0.08,['$\alpha_{\text{init},',num2str(i),'}$'],'HorizontalAlignment','center')
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
% for i = 0:5
|
|
|
|
|
% % plot([i*360/6,i*360/6],[min(r),max(r)],,'LineStyle','--','Color',myGray25)
|
|
|
|
|
% % text(i*360/6,0.02
|
|
|
|
|
%
|
|
|
|
|
% if find(get(gca, 'XTick') == i*360/6)
|
|
|
|
|
%
|
|
|
|
|
% else
|
|
|
|
|
%
|
|
|
|
|
% set(gca, 'XTick', sort([i*360/6, get(gca, 'XTick')]));
|
|
|
|
|
% k = find(get(gca, 'XTick') == i*360/6);
|
|
|
|
|
% l = get(gca,'XTickLabel');
|
|
|
|
|
% l = {l{1:k-1},[],l{k:end}};
|
|
|
|
|
% set(gca,'XTickLabel',l);
|
|
|
|
|
% end
|
|
|
|
|
% xlims = get(gca,'XLim');
|
|
|
|
|
%
|
|
|
|
|
% j=1;
|
|
|
|
|
% stillrunning = 1;
|
|
|
|
|
% ticks = get(gca, 'XTick');
|
|
|
|
|
% labels = get(gca,'XTickLabel');
|
|
|
|
|
% while stillrunning
|
|
|
|
|
% if ticks(j) == i*360/6
|
|
|
|
|
% if j == 1
|
|
|
|
|
% tickresult = {string(['$\alpha_{init,',num2str(i),'}$'])};
|
|
|
|
|
% else
|
|
|
|
|
% tickresult(end+1) = {string(['$\alpha_{init,',num2str(i),'}$'])};
|
|
|
|
|
% end
|
|
|
|
|
%
|
|
|
|
|
% else
|
|
|
|
|
% if j == 1
|
|
|
|
|
% tickresult = {num2str(labels{j})};
|
|
|
|
|
% else
|
|
|
|
|
% tickresult(end+1) = {num2str(labels{j})};
|
|
|
|
|
% end
|
|
|
|
|
%
|
|
|
|
|
% end
|
|
|
|
|
% j = j+1;
|
|
|
|
|
% if j > numel(labels)
|
|
|
|
|
% stillrunning = 0;
|
|
|
|
|
% end
|
|
|
|
|
% end
|
|
|
|
|
%
|
|
|
|
|
% set(gca,'XTickLabel',tickresult);
|
|
|
|
|
%
|
|
|
|
|
%
|
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
xlabel('$\alpha_{k,i}$ {[\SI{}{\degree}]}')
|
|
|
|
|
ylabel('Normalized cost $\tilde{J}_{j,i}/\min\tilde{J}_{j,i}$')
|
|
|
|
|
catch
|
|
|
|
|
blub =0;
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
%% Tikzn
|
|
|
|
|
|
|
|
|
|
matlab2tikz('filename','fitnessNWSA.tex',...
|
|
|
|
|
'height', '\figureheight', 'width', '\figurewidth', 'encoding', 'UTF8', 'showInfo', false, 'checkForUpdates', false, ...
|
|
|
|
|
'parseStrings', false, ... % switch off LaTeX parsing by matlab2tikz for titles, axes labels etc. ("greater flexibility", "use straight LaTeX for your labels")
|
|
|
|
|
'floatFormat', '%.4g', ... % limit precision to get smaller .tikz files
|
|
|
|
|
'noSize', false);
|
|
|
|
|
%
|
|
|
|
|
% axis off
|
|
|
|
|
%
|
|
|
|
|
% hold off
|
|
|
|
|
% box off % Box um die figure herum ausblenden
|
|
|
|
|
|
|
|
|
|
% mit legendflex hat man mehr M<EFBFBD>glichkeiten als mit MATLABs eigener
|
|
|
|
|
% legend-Funktion
|
|
|
|
|
% legendflex({'LF', 'UF'}, ...
|
|
|
|
|
% 'box', 'off', ...
|
|
|
|
|
% 'ncol', 1, ...
|
|
|
|
|
% 'nrow', 2, ...
|
|
|
|
|
% 'anchor', [3, 3], ...
|
|
|
|
|
% 'buffer', [-30, -30], ...
|
|
|
|
|
% 'xscale', 0.5, ...
|
|
|
|
|
% 'padding', [0, 0, 20], ...
|
|
|
|
|
% 'Color', [1, 1, 1], ...
|
|
|
|
|
% 'Interpreter', 'latex', ...
|
|
|
|
|
% 'fontsize', 11)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tightfig; % tightfig entfernt den wei<EFBFBD>en Rand um die figure herum
|
|
|
|
|
% for i = 1:length(ax)
|
|
|
|
|
% % decimal_comma(ax(i), 'XY') % f<EFBFBD>r deutsche Ver<EFBFBD>ffentlichungen kann hiermit der Dezimalpunkt durch ein Dezimal komma ersetzt werden
|
|
|
|
|
% myArrow(ax(i), 'y') % Die Funkion f<EFBFBD>gt je nach zweitem Argument einen Achsenpfeil hinzu
|
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
% FileName_Res = './Figures/PathOptim'; % Dateiname f<EFBFBD>r LaTeX-Export definieren
|
|
|
|
|
% Plot2LaTeX(fig_Res, FileName_Res) % Plot2LaTeX erzeugt aus der figure eine SVG-Datei und daraus ein PDF + LaTeX-Datei f<EFBFBD>r den Text
|
|
|
|
|
|
|
|
|
|
|