Skip to content

Commit

Permalink
issue #54: Refactored the code according to the Coding Policy
Browse files Browse the repository at this point in the history
  • Loading branch information
BabaylovaPolina committed Feb 25, 2018
1 parent bd55a88 commit ef23643
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions products/+elltool/+doc/+snip/s_chapter06_section05_snippet01.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
k2 = 500;
m1 = 150;
m2 = 100;
L = 5;
l = 5;
g = 9.8;
Jc = 100;
jc = 100;

x1 = 1;
v1 = 0;
theta1 = pi/2;
omega1 = 0;
t1 = 1;

d = Jc + m2*L^2/4;
d = jc + m2*l^2/4;
% define matrices aMat, bMat, and control bounds uBoundsEllObj:
aMat = [0, 1, 0, 0; 0, -k1/m1, 0, 0; 0, 0, 0, 1; 0, 0, m2*L*g/2/d, -k2*L/d];
aMat = [0, 1, 0, 0; 0, -k1/m1, 0, 0; 0, 0, 0, 1; 0, 0, m2*l*g/2/d, -k2*l/d];
bMat = [0; 1/m1; 0; 0];
uBoundsEllObj = alpha * ell_unitball(1);
%define disturbance:
gMat = [0; 0; 0; -m2*L*g*pi/4/d];
gMat = [0; 0; 0; -m2*l*g*pi/4/d];
vEllObj = ellipsoid(1, 0); %known disturbance

%linear system
lsys = elltool.linsys.LinSysContinuous(aMat, bMat, uBoundsEllObj,...
lsysObj = elltool.linsys.LinSysContinuous(aMat, bMat, uBoundsEllObj,...
gMat, vEllObj);
timeVec = [t1, 0];
% initial directions:
dirsMat = [1 0 1 0; 1 -1 0 0; 0 -1 0 1; 1 1 -1 1; -1 1 1 0; -2 0 1 1].';
x1EllObj = ellipsoid([x1; v1; theta1; omega1], zeros(4)); %known final point

%backward reach set
brsObj = elltool.reach.ReachContinuous(lsys, x1EllObj, dirsMat, timeVec,...
brsObj = elltool.reach.ReachContinuous(lsysObj, x1EllObj, dirsMat, timeVec,...
'isRegEnabled', true, 'isJustCheck', false, 'regTol', 1e-4,...
'absTol', 1e-5, 'relTol', 1e-4);

Expand Down

0 comments on commit ef23643

Please sign in to comment.