-
Notifications
You must be signed in to change notification settings - Fork 3
/
demo.m
36 lines (31 loc) · 1.15 KB
/
demo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
%% Setup teh demo
setup_CoDs;
Option.limits= [-5 5 -5 5];
Option.check=0;
Option.Deltat=0.001;
Option.F_d=6;
Option.delta_dx=-0.5;
Option.Tfinal=100;
Option.animation=0;
Option.rho=1;
Option.Onsurface=0;
%% Constructing the conatct surface
disp('Draw the contact surface')
[N_x,Poly,X_target,Option.check,fig]=Construct_the_surface(Option);
if Option.check==0
error('Program exit')
end
%% Constructing the dynamcail system
disp('Draw some motions, make sure that it ends up at the target point and it goes through the contact surface !')
[A,X_initial,Option.check]=Construct_the_dynamcial_system(Poly,X_target,X_target,Option,fig);
if Option.check==0
error('Program exit')
end
[X_C,X_L]=Select_the_contact_point(Poly,X_target,X_initial,Option);
%% Simulate the unmodulated system
close all
[DDX_modulated,DX_modulated,X_modulated,F_modulated,Time_modulated]= simulate_modulated_system(A,N_x,Poly,X_initial,X_target,X_target,X_C,X_L,Option);
%%
plot_the_simualtions(DDX_modulated,DX_modulated,X_modulated,F_modulated,Time_modulated,Poly,X_initial,X_target,X_target,X_C,X_L,N_x,Option);
% %
% simulate_unmodulated_system(A,X_initial);