trajectory: cardioid
parent
690013fd1b
commit
58d14dcf9e
|
@ -8,5 +8,7 @@ switch i
|
|||
q0 = [0; 0; pi/6];
|
||||
case 3
|
||||
q0 = [1; 0; 0];
|
||||
case 4
|
||||
q0 = [1; 0; -pi/6];
|
||||
end
|
||||
end
|
|
@ -41,6 +41,10 @@ switch i
|
|||
case 10
|
||||
xref = cos(0.5*s);
|
||||
yref = 0.5 * sin(s);
|
||||
case 11
|
||||
a = 0.5;
|
||||
xref = 2*a*(1-cos(0.5*s))*sin(0.5*s);
|
||||
yref = 2*a*(1-cos(0.5*s))*cos(0.5*s);
|
||||
end
|
||||
|
||||
ref = [xref; yref];
|
||||
|
|
|
@ -15,11 +15,13 @@ for i = 1:s_(2)
|
|||
TEST = convertStringsToChars(TESTS(i))
|
||||
|
||||
sim_data = load(['tests/' TEST '/common.mat']);
|
||||
|
||||
sim_data.q0 = set_initial_conditions(sim_data.INITIAL_CONDITIONS);
|
||||
[ref dref] = set_trajectory(sim_data.TRAJECTORY);
|
||||
sim_data.ref = ref;
|
||||
sim_data.dref = dref;
|
||||
|
||||
|
||||
spmd (3)
|
||||
worker_index = spmdIndex;
|
||||
data = load(['tests/' TEST '/' num2str(spmdIndex) '.mat']);
|
||||
|
@ -33,7 +35,7 @@ for i = 1:s_(2)
|
|||
disp('Done')
|
||||
end
|
||||
|
||||
h = []
|
||||
h = [];
|
||||
s1_ = size(worker_index);
|
||||
for n = 1:s1_(2)
|
||||
h_ = figure('Name', [TEST ' ' num2str(n)] );
|
||||
|
@ -78,6 +80,10 @@ function [t, q, ref_t, U, U_track, U_corr] = simulate_discr(sim_data)
|
|||
U_track = u_track';
|
||||
|
||||
for n = 1:steps
|
||||
sim_data.old_u_corr = u_corr;
|
||||
sim_data.old_u_track = u_track;
|
||||
sim_data.old_u = u_discr;
|
||||
|
||||
tspan = [(n-1)*tc n*tc];
|
||||
z0 = q(end, :);
|
||||
|
||||
|
|
Loading…
Reference in New Issue