Skip to content
Snippets Groups Projects
Commit ff20ab50 authored by Matto's avatar Matto
Browse files

Various updates to Figure 5

parent cb374c3b
No related branches found
No related tags found
No related merge requests found
......@@ -86,14 +86,14 @@ path = "../../Figures_Simplified";
figureLayoutMode = "tiled"
switch figureLayoutMode
case "tiled"
figure(Name='Tiled castor results',Color=[1,1,1],Units="centimeters",Position=[5, 5, 18.3, 12.0]);
figure(Name='Tiled castor results',Color=[1,1,1],Units="centimeters",Position=[5, 5, 18.3, 13.0]);
tiledlayout(1,2); ax1 = nexttile; hold on
otherwise
figure; hold on
end
values_phi_x = [-0.2, -0.1, 0, 0.1, 0.2];
values_delta = linspace(-pi+0.001,pi-0.001,25);
values_delta = linspace(-pi+0.001,pi-0.001,75);
name = "Swivel angle $\delta$ (rad)";
name_iterated_variable = "$\varphi_x$";
......@@ -127,9 +127,9 @@ posfig(3)=0.95*posfig(3); % reduce width
set(gca,'position',posfig); % write the new values
% add lines for reference
xline(pi/2, '--', "Neg. rake", 'HandleVisibility','off', 'LabelVerticalAlignment','bottom', 'Interpreter','latex', Color=[0.5,0.5,0.5], FontSize=8)
xline(-pi/2, '--', "Pos. rake", 'HandleVisibility','off', 'LabelVerticalAlignment','bottom', 'Interpreter','latex', Color=[0.5,0.5,0.5], FontSize=8)
xline(0, '--', "Pos. cant", 'HandleVisibility','off', 'LabelVerticalAlignment','bottom', 'Interpreter','latex', Color=[0.5,0.5,0.5], FontSize=8)
xline(pi/2, '-', "Neg. rake", 'HandleVisibility','off', 'LabelVerticalAlignment','bottom', 'Interpreter','latex', Color=[1;1;1]*0.8, FontSize=8)
xline(-pi/2, '-', "Pos. rake", 'HandleVisibility','off', 'LabelVerticalAlignment','bottom', 'Interpreter','latex', Color=[1;1;1]*0.8, FontSize=8)
xline(0, '-', "Pos. cant", 'HandleVisibility','off', 'LabelVerticalAlignment','bottom', 'Interpreter','latex', Color=[1;1;1]*0.8, FontSize=8)
% xline(0,':','HandleVisibility','off')
% yline(0,':','HandleVisibility','off')
......@@ -148,22 +148,25 @@ for i = 1:length(values_phi_x)
M_D_fun = methods_1_fun.F_M_D(q0, MV0);
B_l_fun = kin_fun.B_l(q0, MV0);
delta_list = [];
delta_list = []; %list to store computed angle between vector l and x. By approximation this is equal to delta.
for idelta = 1:length(values_delta)
B_l = subs(B_l_fun, var.delta, values_delta(idelta));
F_t(i,idelta) = subs(F_t_fun, var.delta, values_delta(idelta));
F_t_cosine(i,idelta) = MV0(MV == var.vertical_load) * MV0(MV == var.phi_x) * cos(values_delta(idelta));
F_t_cosine(i,idelta) = MV0(MV == var.vertical_load) * MV0(MV == var.phi_x) * cos(values_delta(idelta)); % Calculate the lateral force on the castor wheel.
M_D(i,idelta) = norm(double(subs(M_D_fun, var.delta, values_delta(idelta)))); % Calculate the magnitude of the moment on the swivel bearing, expressed in triad F (Fork fixed).
delta_list(idelta) = atan2(B_l(2),B_l(1));
end
b = plot(values_delta, F_t_cosine(i,:), '--', 'Color',[1;1;1]*0.8, 'DisplayName',"Cosine approximation");
a = plot(delta_list, F_t(i,:), '-', 'Color',col(2*i-1,:), 'DisplayName',"Simulated");
if i == 4
a_legend = a;
b_legend = b;
end
text(delta_list(end), F_t(end)', "\hspace{2mm}" + name_iterated_variable + "=" + values_phi_x(i), 'Interpreter','latex',FontSize=8)
......@@ -210,9 +213,9 @@ xlabel(name, 'Interpreter','latex')
ylabel('Normalized lateral force $F_t / F_n$', 'Interpreter','latex')
xlim([-pi,pi])
xticks([-pi, -0.5*pi, 0, 0.5*pi, pi])
xticklabels({'-$\pi$', '-0.5$\pi$', '0', '0.5$\pi$', '$\pi$'})
xticklabels({'-$\pi$', '-$\pi$/2', '0', '$\pi$/2', '$\pi$'})
ylim([-0.3,0.3])
legend([a_legend,c,l], 'Interpreter','latex',Box='off',Location='southoutside')
legend([a_legend,b_legend,l,c], 'Interpreter','latex',Box='off',Location='southoutside')
% Figure of cant angle vs normal force
switch figureLayoutMode
......@@ -238,7 +241,16 @@ for i = 1:length(phi_x_unique)
target = trials_selected.F_t_cosine(1);
s = scatter(trials_selected.F_n, trials_selected.F_t_norm, 'x', 'MarkerEdgeColor', col(4+i,:), "DisplayName","Experimental results for each $\varphi_x$");
a = plot([0;80],[target;target], 'Color', col(4+i,:), "DisplayName","Simulated");
MV0 = sym(var.MV0);
MV0(var.MV == var.phi_x) = phi_x_unique(i);
q0 = sym(zeros(size(var.q_sym)));
q0(var.q_sym == var.delta) = 0;
F_t_sim = double(methods_1_fun.C_F_C_y(q0, MV0));
b = plot([0;80],[target;target], '--', 'Color', [1;1;1]*0.8, "DisplayName","Cosine approximation");
a = plot([0;80],[F_t_sim;F_t_sim], 'Color', col(4+i,:), "DisplayName","Simulated");
F_n_list = sort(unique(trials_selected.F_n));
l = plot(F_n_list, (trials_selected.F_t_norm' * (F_n_list' == trials_selected.F_n) /3)', ':', 'Color', col(4+i,:), "DisplayName","Mean of experimental results");
......@@ -247,6 +259,7 @@ for i = 1:length(phi_x_unique)
if i == 3
a_legend = a;
b_legend = b;
s_legend = s;
l_legend = l;
end
......@@ -265,7 +278,8 @@ ylabel('Normalized lateral force $F_t / F_n$', 'Interpreter','latex')
xlim([0, max(T_data_1.F_n)])
ylim([-0.3,0.3])
xlim([0,80])
legend([a_legend,s_legend,l_legend], 'Interpreter','latex',Box='off',Location='southoutside')
legend([a_legend,b_legend,l_legend,s_legend], 'Interpreter','latex',Box='off',Location='southoutside')
xticks([0, 19.8, 39.3, 57.5, 75.5])
CastorFigure_save_figureXYZiso([], path + "/F_t", 2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment