4.8
0
False
C:\users\wouter\My Documents\studie\ma\mahd\implementation\SCARA\03_motor\motor_physics.emx
2020-7-18 12:37:59
True
parameters
real A = 0.05 {m};
real B = 0.05 {m};
variables
real J0_1_BF1[2];
real J1_2_BF1[2];
real J1_2_BF2[2];
real EE1_BF2[2];
initialequations
J0_1_BF1 = [A/2;0];
J1_2_BF1 = [-A/2;0];
J1_2_BF2 = [B/2;0];
EE1_BF2 = [-B/2;0];
';
type Mainmodel
end;
implementation bg
submodels
Base1 720 680
description '4.81FalseTrueBond Graph\MR\center_of_mass.emx2020-7-17 15:37:54Baseparameters
real I [3,1] = [7.583333333333335e-7; 3.645833333333334e-8; 7.364583333333335e-7] {N.m.s};
real m = 0.0035 {kg};';
type Submodel
ports
power out p [6,1];
signal in Hin [4,4];
power in p1 [6,1];
signal out Hout [4,4];
end;
icon bg bottom
figures
rectangle 688 640 752 720 color 0 fill 255;
text 'COM' 720 664 color 0;
terminals
p 688 656 fixed;
Hin 688 704 fixed;
p1 752 656 fixed;
Hout 752 704 fixed;
end;
implementation bg
submodels
AdHi0 544 400
description '
4.0
1
False
Bond Graph\MTF.emx
2007-9-25 12:3:3
True
';
type MTF
ports
power in p1 [6,1];
power out p2 [6,1];
signal in H [4,4];
restrictions
causality constraint not_equal p1 p2;
end;
icon bg left
figures
text 'MTF' 544 400 color 0 18 bold;
end;
implementation eq
variables
real onlyRotH[4,4];
code
//Only rotations with respect to the inertial system matter!
onlyRotH = H;
onlyRotH[1,4] = 0;
onlyRotH[2,4] = 0;
onlyRotH[3,4] = 0;
p2.e = transpose(Adjoint(onlyRotH)) * p1.e;
p1.f = Adjoint(onlyRotH) * p2.f;
implementation_end;
EJS 616 256
description '
4.0
1
False
Bond Graph\MGY.emx
2007-10-31 11:43:6
True
';
type MGY
ports
power in p1 [6,1];
end;
icon bg top
figures
text 'MGY' 616 256 color 0 18 bold;
end;
implementation eq
//EJS / Gyroscopic effects
parameters
real global I[3];
real global m;
variables
real II[6,6]; //Inertial tensor
real Q[6,6];
real QI[6,6];
real Ia[6];
initialequations
Ia[1:3] = I;
Ia[4:6] = m;
II = diag(Ia);
equations
Q = transpose(adjoint(p1.f));
QI = Q*II;
p1.e = QI*p1.f;implementation_end;
Gravity 616 400
description '
4.0
1
False
Bond Graph\Se.emx
2007-9-25 12:3:26
True
';
type Se
ports
power out p [6,1];
restrictions
causality fixed out p;
end;
icon bg bottom
figures
text 'Se' 616 400 color 0 18 bold;
end;
implementation eq
parameters
real global m;
variables
real effort[6];
equations
effort = [0;0;0;0;0;-g_n*m];
p.e = effort;
implementation_end;
InertialTensor 480 256
description '
4.0
1
False
Bond Graph\I.emx
2007-9-25 12:2:12
True
';
type I
ports
power in p [6,1];
signal out state [6,1];
restrictions
causality preferred in p;
end;
icon bg top
figures
text 'I' 480 256 color 0 18 bold;
end;
implementation eq
parameters
real global I[3];
real global m;
variables
real II[6,6]; //Inertial tensor
real Ia[6];
initialequations
Ia[1:3] = I;
Ia[4:6] = m;
II = diag(Ia);
equations
state = int(p.e); //state = generalized momentum
p.f = inverse(II)*state;
implementation_end;
plug Hin 472 496;
plug p1 752 304;
plug Hout 768 496;
plug p 472 304;
Splitter1 544 496
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [4,4];
signal knot in input [4,4];
end;
icon bg ellipse
figures
ellipse 540.8 492.8 547.2 499.2 color -1 fill 0;
ellipse 539.7 491.7 548.3 500.3 color -1;
terminals
input 544 496 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Ta0j 544 304
description '
4.0
1
False
Bond Graph\OneJunction.emx
2007-9-27 9:51:18
True
';
knot OneJunction
ports
power knot duplicatable none p [6,1];
signal knot out flow [6,1];
restrictions
causality constraint one_out p;
end;
icon bg bottom
figures
text '1' 544 304 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
Ta0k 544 256
description '
4.0
1
False
Bond Graph\OneJunction.emx
2007-9-27 9:51:18
True
';
knot OneJunction
ports
power knot duplicatable none p [6,1];
signal knot out flow [6,1];
restrictions
causality constraint one_out p;
end;
icon bg top
figures
text '1' 544 256 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
end;
connections
AdHi0\p2 => Ta0j\p;
Gravity\p => AdHi0\p1;
Hin -> Splitter1\input;
p <= Ta0j\p;
p1 => Ta0j\p;
Splitter1\output -> AdHi0\H;
Splitter1\output -> Hout;
Ta0j\p => Ta0k\p;
Ta0k\p => EJS\p1;
Ta0k\p => InertialTensor\p;
end;
parameterrelations
InertialTensor\I = I;
InterialTensor\m = m;
EJS\I = I;
EJS\m = m;
AdHik\COMdim = COMdim;
AdHik1\COMdim = COMdim;
Hij\dim = dim;
Gravity\m=m;parameterrelations_end;
figures
text 'b = current link (body)
a = previous link (body)
i = Body fixed frame, fixed in joint with previous link
j = Body fixed frame, fixed in joint with next link
k = Body fixed frame, principal inertial frame
0 = inertial system
' 288 280 color 0;
implementation_end;
Base2 912 680
description '4.81FalseTrueBond Graph\MR\center_of_mass.emx2020-7-17 15:37:54Baseparameters
real I [3,1] = [0;0;0] {N.m.s};
real m = 0.015 {kg};';
type Submodel
ports
power out p [6,1];
signal in Hin [4,4];
power in p1 [6,1];
signal out Hout [4,4];
end;
icon bg bottom
figures
rectangle 880 640 944 720 color 0 fill 255;
text 'COM' 912 664 color 0;
terminals
p 880 656 fixed;
Hin 880 704 fixed;
p1 944 656 fixed;
Hout 944 704 fixed;
end;
implementation bg
submodels
AdHi0 544 400
description '
4.0
1
False
Bond Graph\MTF.emx
2007-9-25 12:3:3
True
';
type MTF
ports
power in p1 [6,1];
power out p2 [6,1];
signal in H [4,4];
restrictions
causality constraint not_equal p1 p2;
end;
icon bg left
figures
text 'MTF' 544 400 color 0 18 bold;
end;
implementation eq
variables
real onlyRotH[4,4];
code
//Only rotations with respect to the inertial system matter!
onlyRotH = H;
onlyRotH[1,4] = 0;
onlyRotH[2,4] = 0;
onlyRotH[3,4] = 0;
p2.e = transpose(Adjoint(onlyRotH)) * p1.e;
p1.f = Adjoint(onlyRotH) * p2.f;
implementation_end;
EJS 616 256
description '
4.0
1
False
Bond Graph\MGY.emx
2007-10-31 11:43:6
True
';
type MGY
ports
power in p1 [6,1];
end;
icon bg top
figures
text 'MGY' 616 256 color 0 18 bold;
end;
implementation eq
//EJS / Gyroscopic effects
parameters
real global I[3];
real global m;
variables
real II[6,6]; //Inertial tensor
real Q[6,6];
real QI[6,6];
real Ia[6];
initialequations
Ia[1:3] = I;
Ia[4:6] = m;
II = diag(Ia);
equations
Q = transpose(adjoint(p1.f));
QI = Q*II;
p1.e = QI*p1.f;implementation_end;
Gravity 616 400
description '
4.0
1
False
Bond Graph\Se.emx
2007-9-25 12:3:26
True
';
type Se
ports
power out p [6,1];
restrictions
causality fixed out p;
end;
icon bg bottom
figures
text 'Se' 616 400 color 0 18 bold;
end;
implementation eq
parameters
real global m;
variables
real effort[6];
equations
effort = [0;0;0;0;0;-g_n*m];
p.e = effort;
implementation_end;
InertialTensor 480 256
description '
4.0
1
False
Bond Graph\I.emx
2007-9-25 12:2:12
True
';
type I
ports
power in p [6,1];
signal out state [6,1];
restrictions
causality preferred in p;
end;
icon bg top
figures
text 'I' 480 256 color 0 18 bold;
end;
implementation eq
parameters
real global I[3];
real global m;
variables
real II[6,6]; //Inertial tensor
real Ia[6];
initialequations
Ia[1:3] = I;
Ia[4:6] = m;
II = diag(Ia);
equations
state = int(p.e); //state = generalized momentum
p.f = inverse(II)*state;
implementation_end;
plug Hin 472 496;
plug p1 752 304;
plug Hout 768 496;
plug p 472 304;
Splitter1 544 496
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [4,4];
signal knot in input [4,4];
end;
icon bg ellipse
figures
ellipse 540.8 492.8 547.2 499.2 color -1 fill 0;
ellipse 539.7 491.7 548.3 500.3 color -1;
terminals
input 544 496 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Ta0j 544 304
description '
4.0
1
False
Bond Graph\OneJunction.emx
2007-9-27 9:51:18
True
';
knot OneJunction
ports
power knot duplicatable none p [6,1];
signal knot out flow [6,1];
restrictions
causality constraint one_out p;
end;
icon bg bottom
figures
text '1' 544 304 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
Ta0k 544 256
description '
4.0
1
False
Bond Graph\OneJunction.emx
2007-9-27 9:51:18
True
';
knot OneJunction
ports
power knot duplicatable none p [6,1];
signal knot out flow [6,1];
restrictions
causality constraint one_out p;
end;
icon bg top
figures
text '1' 544 256 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
end;
connections
AdHi0\p2 => Ta0j\p;
Gravity\p => AdHi0\p1;
Hin -> Splitter1\input;
p <= Ta0j\p;
p1 => Ta0j\p;
Splitter1\output -> AdHi0\H;
Splitter1\output -> Hout;
Ta0j\p => Ta0k\p;
Ta0k\p => EJS\p1;
Ta0k\p => InertialTensor\p;
end;
parameterrelations
InertialTensor\I = I;
InterialTensor\m = m;
EJS\I = I;
EJS\m = m;
AdHik\COMdim = COMdim;
AdHik1\COMdim = COMdim;
Hij\dim = dim;
Gravity\m=m;parameterrelations_end;
figures
text 'b = current link (body)
a = previous link (body)
i = Body fixed frame, fixed in joint with previous link
j = Body fixed frame, fixed in joint with next link
k = Body fixed frame, principal inertial frame
0 = inertial system
' 288 280 color 0;
implementation_end;
Base3 368 680
description '
4.8
1
False
True
Bond Graph\MR\center_of_mass.emx
2020-7-17 15:37:54
Base
parameters
real I [3,1] = [1.6399999999999998e-6; 4.7e-8; 1.61e-6] {N.m.s};
real m = 0.00455 {kg};
';
type Submodel
ports
power out p [6,1];
signal in Hin [4,4];
power in p1 [6,1];
signal out Hout [4,4];
end;
icon bg bottom
figures
rectangle 336 640 400 720 color 0 fill 255;
text 'COM' 368 664 color 0;
terminals
p 336 656 fixed;
Hin 336 704 fixed;
p1 400 656 fixed;
Hout 400 704 fixed;
end;
implementation bg
submodels
AdHi0 544 400
description '
4.0
1
False
Bond Graph\MTF.emx
2007-9-25 12:3:3
True
';
type MTF
ports
power in p1 [6,1];
power out p2 [6,1];
signal in H [4,4];
restrictions
causality constraint not_equal p1 p2;
end;
icon bg left
figures
text 'MTF' 544 400 color 0 18 bold;
end;
implementation eq
variables
real onlyRotH[4,4];
code
//Only rotations with respect to the inertial system matter!
onlyRotH = H;
onlyRotH[1,4] = 0;
onlyRotH[2,4] = 0;
onlyRotH[3,4] = 0;
p2.e = transpose(Adjoint(onlyRotH)) * p1.e;
p1.f = Adjoint(onlyRotH) * p2.f;
implementation_end;
EJS 616 256
description '
4.0
1
False
Bond Graph\MGY.emx
2007-10-31 11:43:6
True
';
type MGY
ports
power in p1 [6,1];
end;
icon bg top
figures
text 'MGY' 616 256 color 0 18 bold;
end;
implementation eq
//EJS / Gyroscopic effects
parameters
real global I[3];
real global m;
variables
real II[6,6]; //Inertial tensor
real Q[6,6];
real QI[6,6];
real Ia[6];
initialequations
Ia[1:3] = I;
Ia[4:6] = m;
II = diag(Ia);
equations
Q = transpose(adjoint(p1.f));
QI = Q*II;
p1.e = QI*p1.f;implementation_end;
Gravity 616 400
description '
4.0
1
False
Bond Graph\Se.emx
2007-9-25 12:3:26
True
';
type Se
ports
power out p [6,1];
restrictions
causality fixed out p;
end;
icon bg bottom
figures
text 'Se' 616 400 color 0 18 bold;
end;
implementation eq
parameters
real global m;
variables
real effort[6];
equations
effort = [0;0;0;0;0;-g_n*m];
p.e = effort;
implementation_end;
InertialTensor 480 256
description '
4.0
1
False
Bond Graph\I.emx
2007-9-25 12:2:12
True
';
type I
ports
power in p [6,1];
signal out state [6,1];
restrictions
causality preferred in p;
end;
icon bg top
figures
text 'I' 480 256 color 0 18 bold;
end;
implementation eq
parameters
real global I[3];
real global m;
variables
real II[6,6]; //Inertial tensor
real Ia[6];
initialequations
Ia[1:3] = I;
Ia[4:6] = m;
II = diag(Ia);
equations
state = int(p.e); //state = generalized momentum
p.f = inverse(II)*state;
implementation_end;
plug Hin 472 496;
plug p1 752 304;
plug Hout 768 496;
plug p 472 304;
Splitter1 544 496
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [4,4];
signal knot in input [4,4];
end;
icon bg ellipse
figures
ellipse 540.8 492.8 547.2 499.2 color -1 fill 0;
ellipse 539.7 491.7 548.3 500.3 color -1;
terminals
input 544 496 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Ta0j 544 304
description '
4.0
1
False
Bond Graph\OneJunction.emx
2007-9-27 9:51:18
True
';
knot OneJunction
ports
power knot duplicatable none p [6,1];
signal knot out flow [6,1];
restrictions
causality constraint one_out p;
end;
icon bg bottom
figures
text '1' 544 304 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
Ta0k 544 256
description '
4.0
1
False
Bond Graph\OneJunction.emx
2007-9-27 9:51:18
True
';
knot OneJunction
ports
power knot duplicatable none p [6,1];
signal knot out flow [6,1];
restrictions
causality constraint one_out p;
end;
icon bg top
figures
text '1' 544 256 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
end;
connections
AdHi0\p2 => Ta0j\p;
Gravity\p => AdHi0\p1;
Hin -> Splitter1\input;
p <= Ta0j\p;
p1 => Ta0j\p;
Splitter1\output -> AdHi0\H;
Splitter1\output -> Hout;
Ta0j\p => Ta0k\p;
Ta0k\p => EJS\p1;
Ta0k\p => InertialTensor\p;
end;
parameterrelations
InertialTensor\I = I;
InterialTensor\m = m;
EJS\I = I;
EJS\m = m;
AdHik\COMdim = COMdim;
AdHik1\COMdim = COMdim;
Hij\dim = dim;
Gravity\m=m;parameterrelations_end;
figures
text 'b = current link (body)
a = previous link (body)
i = Body fixed frame, fixed in joint with previous link
j = Body fixed frame, fixed in joint with next link
k = Body fixed frame, principal inertial frame
0 = inertial system
' 288 280 color 0;
implementation_end;
COM1 424 584
description '4.81parameters
real mass = 1 {kg};';
type Submodel
ports
translation in p [2,1];
signal in mass {kg} ;
end;
icon bg ellipse bottom
figures
ellipse 416 576 432 592 color 0 fill 15132390;
line 424 576 424 592 color 0 fill 15132390;
line 416 584 432 584 color 0 fill 15132390;
end;
implementation bg
submodels
Gain 368 408
description '4.01False
Signal\Block Diagram\Gain.emx
2007-9-26 12:15:12
';
type Gain
ports
signal in input;
signal out output [2,1];
end;
icon bg bottom
figures
rectangle 352.1 392 383.9 424 color 0 fill 15132390;
text 'K' 368 408 color 16711680 16 bold;
end;
implementation eq
equations
output = [0;-g_n] * input;
implementation_end;
I 248 520
description '4.01False
Bond Graph\2D\I-2.emx
2007-9-25 12:7:37
';
type 'I-2'
ports
power in p [2,1];
signal out state [2,1];
signal in mass {kg} ;
restrictions
causality preferred in p;
end;
icon bg bottom
figures
text 'I' 248 520 color 0 18 bold;
end;
implementation eq
equations
state = int(p.e);
p.f = inverse ([mass,0;0,mass]) * state;
implementation_end;
plug p 304 468;
plug mass 208 408;
OneJunction2 304 520
description '4.01False
Bond Graph\OneJunction.emx
2007-9-27 9:51:18
';
knot OneJunction
ports
translation knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 304 520 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
Sg 368 520
description '4.01False
Bond Graph\2D\MSe-2.emx
2007-9-25 12:7:58
';
type 'MSe-2'
ports
power out p [2,1];
signal in effort [2,1];
restrictions
causality fixed out p;
end;
icon bg bottom
figures
text 'MSe' 368 520 color 0 18 bold;
end;
implementation eq
variables
real flow[2];
equations
p.e = effort;
flow = p.f;
implementation_end;
Splitter1 248 408
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [1];
signal knot in input [1];
end;
icon bg ellipse
figures
ellipse 244.8 404.8 251.2 411.2 color -1 fill 0;
ellipse 243.7 403.7 252.3 412.3 color -1;
terminals
input 248 408 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
end;
connections
Gain\output -> Sg\effort;
I\p <= OneJunction2\p;
mass -> Splitter1\input;
p => OneJunction2\p;
Sg\p => OneJunction2\p;
Splitter1\output -> Gain\input;
Splitter1\output -> I\mass;
end;
implementation_end;
COM2 824 584
description '4.81parameters
real mass = 1 {kg};';
type Submodel
ports
power in p [2,1];
signal in mass {kg} ;
end;
icon bg ellipse
figures
ellipse 816 576 832 592 color 0 fill 15132390;
line 824 576 824 592 color 0 fill 15132390;
line 816 584 832 584 color 0 fill 15132390;
end;
implementation bg
submodels
Gain 368 408
description '4.01False
Signal\Block Diagram\Gain.emx
2007-9-26 12:15:12
';
type Gain
ports
signal in input;
signal out output [2,1];
end;
icon bg bottom
figures
rectangle 352.1 392 383.9 424 color 0 fill 15132390;
text 'K' 368 408 color 16711680 16 bold;
end;
implementation eq
equations
output = [0;-g_n] * input;
implementation_end;
I 248 520
description '4.01False
Bond Graph\2D\I-2.emx
2007-9-25 12:7:37
';
type 'I-2'
ports
power in p [2,1];
signal out state [2,1];
signal in mass {kg} ;
restrictions
causality preferred in p;
end;
icon bg bottom
figures
text 'I' 248 520 color 0 18 bold;
end;
implementation eq
equations
state = int(p.e);
p.f = inverse ([mass,0;0,mass]) * state;
implementation_end;
plug p 304 468;
plug mass 208 408;
OneJunction2 304 520
description '4.01False
Bond Graph\OneJunction.emx
2007-9-27 9:51:18
';
knot OneJunction
ports
power knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 304 520 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
Sg 368 520
description '4.01False
Bond Graph\2D\MSe-2.emx
2007-9-25 12:7:58
';
type 'MSe-2'
ports
power out p [2,1];
signal in effort [2,1];
restrictions
causality fixed out p;
end;
icon bg bottom
figures
text 'MSe' 368 520 color 0 18 bold;
end;
implementation eq
variables
real flow[2];
equations
p.e = effort;
flow = p.f;
implementation_end;
Splitter1 248 408
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [1];
signal knot in input [1];
end;
icon bg ellipse
figures
ellipse 244.8 404.8 251.2 411.2 color -1 fill 0;
ellipse 243.7 403.7 252.3 412.3 color -1;
terminals
input 248 408 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
end;
connections
Gain\output -> Sg\effort;
I\p <= OneJunction2\p;
mass -> Splitter1\input;
p => OneJunction2\p;
Sg\p => OneJunction2\p;
Splitter1\output -> Gain\input;
Splitter1\output -> I\mass;
end;
implementation_end;
COM3 984 584
description '4.81parameters
real mass = 1 {kg};';
type Submodel
ports
power in p [2,1];
signal in mass {kg} ;
end;
icon bg ellipse
figures
ellipse 976 576 992 592 color 0 fill 15132390;
line 984 576 984 592 color 0 fill 15132390;
line 976 584 992 584 color 0 fill 15132390;
end;
implementation bg
submodels
Gain 368 408
description '4.01False
Signal\Block Diagram\Gain.emx
2007-9-26 12:15:12
';
type Gain
ports
signal in input;
signal out output [2,1];
end;
icon bg bottom
figures
rectangle 352.1 392 383.9 424 color 0 fill 15132390;
text 'K' 368 408 color 16711680 16 bold;
end;
implementation eq
equations
output = [0;-g_n] * input;
implementation_end;
I 248 520
description '4.01False
Bond Graph\2D\I-2.emx
2007-9-25 12:7:37
';
type 'I-2'
ports
power in p [2,1];
signal out state [2,1];
signal in mass {kg} ;
restrictions
causality preferred in p;
end;
icon bg bottom
figures
text 'I' 248 520 color 0 18 bold;
end;
implementation eq
equations
state = int(p.e);
p.f = inverse ([mass,0;0,mass]) * state;
implementation_end;
plug p 304 468;
plug mass 208 408;
OneJunction2 304 520
description '4.01False
Bond Graph\OneJunction.emx
2007-9-27 9:51:18
';
knot OneJunction
ports
power knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 304 520 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
Sg 368 520
description '4.01False
Bond Graph\2D\MSe-2.emx
2007-9-25 12:7:58
';
type 'MSe-2'
ports
power out p [2,1];
signal in effort [2,1];
restrictions
causality fixed out p;
end;
icon bg bottom
figures
text 'MSe' 368 520 color 0 18 bold;
end;
implementation eq
variables
real flow[2];
equations
p.e = effort;
flow = p.f;
implementation_end;
Splitter1 248 408
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [1];
signal knot in input [1];
end;
icon bg ellipse
figures
ellipse 244.8 404.8 251.2 411.2 color -1 fill 0;
ellipse 243.7 403.7 252.3 412.3 color -1;
terminals
input 248 408 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
end;
connections
Gain\output -> Sg\effort;
I\p <= OneJunction2\p;
mass -> Splitter1\input;
p => OneJunction2\p;
Sg\p => OneJunction2\p;
Splitter1\output -> Gain\input;
Splitter1\output -> I\mass;
end;
implementation_end;
Constant 920 584
description '4.01False
Signal\Sources\Constant.emx
2007-10-19 14:48:44
';
type Constant
ports
signal out output;
end;
icon bg bottom
figures
rectangle 904.1 568 935.9 600 color 0 fill 15132390;
line 908.9 579.6 930.9 579.6 color 16711680 width 2;
line 906.2 590.7 931.9 590.7 color 0;
line 908.5 574.7 908.5 593 color 0;
end;
implementation eq
parameters
real C = 0.015 {kg}; // output value
equations
output = C;
implementation_end;
I 432 176
description '
4.2
1
False
Bond Graph\I.emx
2011-11-29 15:55:55
';
type I
ports
power in p;
signal out state;
signal in i;
restrictions
causality preferred in p;
end;
icon bg bottom
figures
text 'I' 432 176 color 0 18 bold;
end;
implementation eq
equations
state = int(p.e);
p.f = state / i;
implementation_end;
I1 824 176
description '
4.2
1
False
Bond Graph\I.emx
2011-11-29 15:55:55
';
type I
ports
power in p;
signal out state;
signal in i;
restrictions
causality preferred in p;
end;
icon bg bottom
figures
text 'I' 824 176 color 0 18 bold;
end;
implementation eq
equations
state = int(p.e);
p.f = state / i;
implementation_end;
Integrate 1040 512
description '
4.3
1
False
Signal\Block Diagram\Integrate.emx
2013-3-8 14:47:42
';
type Integrate
ports
signal in input [2,1];
signal out output [2,1];
end;
icon bg bottom
figures
rectangle 1024 496 1056 528 color 0 fill 15132390;
text '∫' 1040 512.3 color 16711680 'Lucida Sans' 21 italic;
end;
implementation eq
parameters
real initial[2] = [0.115;0]; // initial value
equations
output = int (input, initial);
implementation_end;
Integrate1 712 192
description '
4.3
1
False
Signal\Block Diagram\Integrate.emx
2013-3-8 14:47:42
';
type Integrate
ports
signal in input;
signal out output;
end;
icon bg bottom
figures
rectangle 696 176 728 208 color 0 fill 15132390;
text '∫' 712 192.3 color 16711680 'Lucida Sans' 21 italic;
end;
implementation eq
parameters
real initial = 0; // initial value
equations
output = int (input, initial);
implementation_end;
inverse_kinematics 304 32
description '
4.8
SCARA\inverse_kinematics_v1.emx
1
False
2020-7-10 12:26:18
False
';
type 'Submodel-Equation'
ports
signal in input [2,1] {m} ;
signal out angle1 {rad} ;
signal out angle2 {rad} ;
signal out a {rad} ;
signal out b {rad} ;
signal out c {rad} ;
signal out phi {rad} ;
end;
implementation eq
parameters
real A_length = 0.065 {m}; // length of first arm
real B_length = 0.05 {m}; // length of second arm
real to_rad = 1 {rad};
variables
real x {m}, y {m};
real C_length {m}; // length to x and y.
real angle_sum {rad}; // test angle
equations
x = input[1];
y = input[2];
phi = atan2(y, x);
C_length = sqrt(x^2 + y^2);
a = arccos ((B_length^2 + C_length^2 - A_length^2) / (2 * B_length * C_length));
b = arccos ((A_length^2 + C_length^2 - B_length^2) / (2 * A_length * C_length));
c = arccos ((A_length^2 + B_length^2 - C_length^2) / (2 * A_length * B_length));
angle1 = b + phi;
angle2 = angle1 - pi * to_rad + c;
implementation_end;
inverse_kinematics1 392 864
description '
4.8
SCARA\inverse_kinematics_v1.emx
1
False
2020-7-10 12:26:18
False
';
type 'Submodel-Equation'
ports
signal in input [2,1] {m} ;
signal out angle1 {rad} ;
signal out angle2 {rad} ;
signal out a {rad} ;
signal out b {rad} ;
signal out c {rad} ;
signal out phi {rad} ;
signal out abs_angle2;
end;
implementation eq
parameters
real A_length = 0.065 {m}; // length of first arm
real B_length = 0.05 {m}; // length of second arm
real to_rad = 1 {rad};
variables
real x {m}, y {m};
real C_length {m}; // length to x and y.
real angle_sum {rad}; // test angle
equations
x = input[1];
y = input[2];
phi = atan2(y, x);
C_length = sqrt(x^2 + y^2);
a = arccos ((B_length^2 + C_length^2 - A_length^2) / (2 * B_length * C_length));
b = arccos ((A_length^2 + C_length^2 - B_length^2) / (2 * A_length * C_length));
c = arccos ((A_length^2 + B_length^2 - C_length^2) / (2 * A_length * B_length));
angle1 = b + phi;
abs_angle2 = angle1 - pi * to_rad + c;
angle2 = c - pi * to_rad;
implementation_end;
Joint1 208.1 678
description '
4.8
1
False
True
Bond Graph\MR\joint-v2.emx
2020-7-17 16:52:13
';
type 'Submodel-rotz'
ports
power out p [6,1];
power in p1;
power in p2 [6,1];
signal in Hin [4,4];
signal out Hout [4,4];
signal out q;
end;
icon bg bottom
figures
rectangle 176.2 640 240 716 color 0 fill 14745599;
text 'Joint' 208 672 color 0;
terminals
p 176 656 fixed;
p1 208 640 fixed;
p2 240 656 fixed;
Hin 176 704 fixed;
Hout 240 704 fixed;
end;
implementation bg
submodels
AdHji 424 424
description '
4.0
1
False
Bond Graph\MTF.emx
2007-9-25 12:3:3
True
';
type MTF
ports
power out p1 [6,1];
power in p2 [6,1];
signal in H [4,4];
restrictions
causality constraint not_equal p1 p2;
end;
icon bg bottom
figures
text 'MTF' 424 424 color 0 18 bold;
end;
implementation eq
equations
p2.e = transpose(Adjoint(H)) * p1.e;
p1.f = Adjoint(H) * p2.f;implementation_end;
JointType 240 312
description '4.81FalseTrueparameters
real joint = 1;
real initial = 0;';
type Submodel
ports
mechanical in p1;
signal out output [4,4];
power out p2 [6,1];
signal out q;
end;
implementation bg
submodels
Integrate 320 272
description '
4.0
1
False
Signal\Block Diagram\Integrate.emx
2007-9-26 12:3:23
True
';
type Integrate
ports
signal in input;
signal out output [4,4];
signal out q;
end;
icon bg
figures
rectangle 304 256 336 288 color 0 fill 15132390;
text 'ò' 320 269.3 color 16711680 'SymbolProp BT' 21 symbol;
end;
implementation eq
parameters
real global joint;
real global initial;
variables
real R[3,3];
real p[3];
real qa[6];
real temp [4,4];
initialequations
qa = 0;
equations
-q = int(input,initial);
qa[joint] = q;
R = dll('EulerAngles.dll','RotationMatrixFromEulXYZs',qa);
output = homogeneous(R,qa[4:6]);implementation_end;
plug p1 240 188;
plug output 320 416;
plug p2 240 412;
plug q 320 184;
OneJunction2 240 271.9
description '
4.2
1
False
Bond Graph\FlowSensor.emx
2011-11-29 15:50:53
';
knot FlowSensor
ports
mechanical knot in p1 [1];
mechanical knot out p2 [1];
signal knot out flow [1];
restrictions
causality constraint not_equal p1 p2;
end;
icon bg ellipse
figures
ellipse 233.1 264.8 246.9 279.1 color 0 fill 16777215;
text 'f' 240 271.2 color 0;
end;
implementation eq
equations
p2.f = p1.f;
p1.e = p2.e;
flow = p1.f;
implementation_end;
uTbai 240 312
description '
4.0
1
False
Bond Graph\TF.emx
2007-9-25 12:4:2
True
';
type TF
ports
power in p1;
power out p2 [6,1];
restrictions
causality constraint not_equal p1 p2;
causality fixed in p1;
causality fixed out p2;
parameters
real Cconstraint = 1.0e-4;
real Rconstraint = 1000.0;
end;
icon bg left
figures
text 'TF' 240 312 color 0 18 bold;
end;
implementation eq
parameters
real global joint;
variables
real i;
real state[6];
equations
state = int(p2.f);
for i = 1 to 6 do
if i == joint then
p1.f = p2.f[i];
p2.e[i] = p1.e;
else
p2.e[i] = (Rconstraint*-p2.f[i] + -state[i]/Cconstraint);
end;
end;
implementation_end;
end;
connections
Integrate\output -> output;
Integrate\q -> q;
OneJunction2\flow -> Integrate\input;
OneJunction2\p2 => uTbai\p1;
p1 => OneJunction2\p1;
uTbai\p2 => p2;
end;
implementation_end;
MatrixMul 320 576
description '
4.0
1
False
Signal\Block Diagram\Gain.emx
2007-9-26 12:15:12
True
';
type Gain
ports
signal in input1 [4,4];
signal out output [4,4];
signal in input2 [4,4];
end;
icon bg bottom
figures
rectangle 304.1 560 335.9 592 color 0 fill 15132390;
text 'X' 320 576 color 16711680 16 bold;
end;
implementation eq
equations
output = input2*input1; implementation_end;
plug p 112 424;
plug p1 240 40;
plug p2 496 424;
plug Hin 112 576;
plug Hout 504 576;
plug q 112 312;
Splitter2 320 312
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [4,4];
signal knot in input [4,4];
end;
icon bg ellipse
figures
ellipse 316.8 308.8 323.2 315.2 color -1 fill 0;
ellipse 315.7 307.7 324.3 316.3 color -1;
terminals
input 320 312 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Wbai 240 424
description '
4.0
1
False
Bond Graph\ZeroJunction.emx
2007-9-27 9:51:43
True
';
knot ZeroJunction
ports
power knot duplicatable none p [6,1];
signal knot out effort [6,1];
restrictions
causality constraint one_in p;
end;
icon bg bottom
figures
text '0' 240 424 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.f)) = 0;
equal (collect (p.e));
effort = first (p.e);
implementation_end;
end;
connections
Hin -> MatrixMul\input2;
JointType\output -> Splitter2\input;
JointType\p1 <= p1;
JointType\p2 => Wbai\p;
JointType\q -> q;
MatrixMul\output -> Hout;
p <= Wbai\p;
p2 => AdHji\p2;
Splitter2\output -> AdHji\H 424 312;
Splitter2\output -> MatrixMul\input1;
Wbai\p <= AdHji\p1;
end;
parameterrelations
EndstopMin\Rendstop = Rendstop;
EndstopMin\Cendstop = Cendstop;
EndstopMin\InitialPos = InitialPos;
EndstopMin\EndstopPos = MinEndstopPos;
EndstopMax\Rendstop = Rendstop;
EndstopMax\Cendstop = Cendstop;
EndstopMax\InitialPos = InitialPos;
EndstopMax\EndstopPos = MaxEndstopPos;
Rjoint\Rjoint= Rjoint;
Integrate\init = InitialPos;
uTbai\Rconstraint = Rconstraint;
uTbai\Cconstraint = Cconstraint;
parameterrelations_end;
figures
text 'b = next link (body)
a = previous link (body)
i = Frame fixed in previous body, fixed in joint
j = Frame fixed in next body, fixed in joint
' 680 488 color 0;
implementation_end;
Joint2 560.1 678
description '
4.8
1
False
True
Bond Graph\MR\joint-v2.emx
2020-7-17 16:52:13
';
type 'Submodel-rotz'
ports
power out p [6,1];
power in p1;
power in p2 [6,1];
signal in Hin [4,4];
signal out Hout [4,4];
signal out q;
end;
icon bg bottom
figures
rectangle 528.2 640 592 716 color 0 fill 14745599;
text 'Joint' 560 672 color 0;
terminals
p 528 656 fixed;
p1 560 640 fixed;
p2 592 656 fixed;
Hin 528 704 fixed;
Hout 592 704 fixed;
end;
implementation bg
submodels
AdHji 424 424
description '
4.0
1
False
Bond Graph\MTF.emx
2007-9-25 12:3:3
True
';
type MTF
ports
power out p1 [6,1];
power in p2 [6,1];
signal in H [4,4];
restrictions
causality constraint not_equal p1 p2;
end;
icon bg bottom
figures
text 'MTF' 424 424 color 0 18 bold;
end;
implementation eq
equations
p2.e = transpose(Adjoint(H)) * p1.e;
p1.f = Adjoint(H) * p2.f;implementation_end;
JointType 240 312
description '4.81FalseTrueparameters
real joint = 1;
real initial = 0;';
type Submodel
ports
mechanical in p1;
signal out output [4,4];
power out p2 [6,1];
signal out q;
end;
implementation bg
submodels
Integrate 320 272
description '
4.0
1
False
Signal\Block Diagram\Integrate.emx
2007-9-26 12:3:23
True
';
type Integrate
ports
signal in input;
signal out output [4,4];
signal out q;
end;
icon bg
figures
rectangle 304 256 336 288 color 0 fill 15132390;
text 'ò' 320 269.3 color 16711680 'SymbolProp BT' 21 symbol;
end;
implementation eq
parameters
real global joint;
real global initial;
variables
real R[3,3];
real p[3];
real qa[6];
real temp [4,4];
initialequations
qa = 0;
equations
-q = int(input,initial);
qa[joint] = q;
R = dll('EulerAngles.dll','RotationMatrixFromEulXYZs',qa);
output = homogeneous(R,qa[4:6]);implementation_end;
plug p1 240 188;
plug output 320 416;
plug p2 240 412;
plug q 320 184;
OneJunction2 240 271.9
description '
4.2
1
False
Bond Graph\FlowSensor.emx
2011-11-29 15:50:53
';
knot FlowSensor
ports
mechanical knot in p1 [1];
mechanical knot out p2 [1];
signal knot out flow [1];
restrictions
causality constraint not_equal p1 p2;
end;
icon bg ellipse
figures
ellipse 233.1 264.8 246.9 279.1 color 0 fill 16777215;
text 'f' 240 271.2 color 0;
end;
implementation eq
equations
p2.f = p1.f;
p1.e = p2.e;
flow = p1.f;
implementation_end;
uTbai 240 328
description '
4.0
1
False
Bond Graph\TF.emx
2007-9-25 12:4:2
True
';
type TF
ports
power in p1;
power out p2 [6,1];
restrictions
causality constraint not_equal p1 p2;
causality fixed in p1;
causality fixed out p2;
parameters
real Cconstraint = 1.0e-4;
real Rconstraint = 1000.0;
end;
icon bg left
figures
text 'TF' 240 328 color 0 18 bold;
end;
implementation eq
parameters
real global joint;
variables
real i;
real state[6];
equations
state = int(p2.f);
for i = 1 to 6 do
if i == joint then
p1.f = p2.f[i];
p2.e[i] = p1.e;
else
p2.e[i] = (Rconstraint*-p2.f[i] + -state[i]/Cconstraint);
end;
end;
implementation_end;
end;
connections
Integrate\output -> output;
Integrate\q -> q;
OneJunction2\flow -> Integrate\input;
OneJunction2\p2 => uTbai\p1;
p1 => OneJunction2\p1;
uTbai\p2 => p2;
end;
implementation_end;
MatrixMul 320 576
description '
4.0
1
False
Signal\Block Diagram\Gain.emx
2007-9-26 12:15:12
True
';
type Gain
ports
signal in input1 [4,4];
signal out output [4,4];
signal in input2 [4,4];
end;
icon bg bottom
figures
rectangle 304.1 560 335.9 592 color 0 fill 15132390;
text 'X' 320 576 color 16711680 16 bold;
end;
implementation eq
equations
output = input2*input1; implementation_end;
plug p 112 424;
plug p1 240 40;
plug p2 496 424;
plug Hin 112 576;
plug Hout 504 576;
plug q 112 312;
Splitter2 320 312
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [4,4];
signal knot in input [4,4];
end;
icon bg ellipse
figures
ellipse 316.8 308.8 323.2 315.2 color -1 fill 0;
ellipse 315.7 307.7 324.3 316.3 color -1;
terminals
input 320 312 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Wbai 240 424
description '
4.0
1
False
Bond Graph\ZeroJunction.emx
2007-9-27 9:51:43
True
';
knot ZeroJunction
ports
power knot duplicatable none p [6,1];
signal knot out effort [6,1];
restrictions
causality constraint one_in p;
end;
icon bg bottom
figures
text '0' 240 424 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.f)) = 0;
equal (collect (p.e));
effort = first (p.e);
implementation_end;
end;
connections
Hin -> MatrixMul\input2;
JointType\output -> Splitter2\input;
JointType\p1 <= p1;
JointType\p2 => Wbai\p;
JointType\q -> q;
MatrixMul\output -> Hout;
p <= Wbai\p;
p2 => AdHji\p2;
Splitter2\output -> AdHji\H 424 312;
Splitter2\output -> MatrixMul\input1;
Wbai\p <= AdHji\p1;
end;
parameterrelations
EndstopMin\Rendstop = Rendstop;
EndstopMin\Cendstop = Cendstop;
EndstopMin\InitialPos = InitialPos;
EndstopMin\EndstopPos = MinEndstopPos;
EndstopMax\Rendstop = Rendstop;
EndstopMax\Cendstop = Cendstop;
EndstopMax\InitialPos = InitialPos;
EndstopMax\EndstopPos = MaxEndstopPos;
Rjoint\Rjoint= Rjoint;
Integrate\init = InitialPos;
uTbai\Rconstraint = Rconstraint;
uTbai\Cconstraint = Cconstraint;
parameterrelations_end;
figures
text 'b = next link (body)
a = previous link (body)
i = Frame fixed in previous body, fixed in joint
j = Frame fixed in next body, fixed in joint
' 680 488 color 0;
implementation_end;
Link 288 680
description '
4.8
Z:\home\wouter\Documents\20-sim\library\Bond Graph\MR\link-v2.emx
1
False
2020-7-16 17:44:32
False
';
type 'Submodel-Equation'
ports
signal in Hin [4,4];
signal out Hout [4,4];
power in Pin [6,1];
power out Pout [6,1];
restrictions
causality constraint not_equal Pin Pout;
end;
icon bg bottom
figures
rectangle 256 640 320 720 color 0 fill 8454041;
text 'name' 288 664 color 0 'Clear Sans' 16;
terminals
Hin 256 704 fixed;
Hout 320 704 fixed;
Pin 320 656 fixed;
Pout 256 656 fixed;
end;
implementation eq
parameters
real offset[3]= [0; 0.0325; 0]; //coordinates of joint_1
variables
real Hab[4,4];
real AdHab[6,6];
equations
Hab = homogeneous(eye(3),offset);
AdHab = Adjoint(eye(3),offset);
Hout = Hin * Hab;
Pout.e = transpose(AdHab) * Pin.e;
Pin.f = AdHab * Pout.f;
implementation_end;
Link1 480 680
description '
4.8
Z:\home\wouter\Documents\20-sim\library\Bond Graph\MR\link-v2.emx
1
False
2020-7-16 17:44:32
False
';
type 'Submodel-Equation'
ports
signal in Hin [4,4];
signal out Hout [4,4];
power in Pin [6,1];
power out Pout [6,1];
restrictions
causality constraint not_equal Pin Pout;
end;
icon bg bottom
figures
rectangle 448 640 512 720 color 0 fill 8454041;
text 'name' 480 664 color 0 'Clear Sans' 16;
terminals
Hin 448 704 fixed;
Hout 512 704 fixed;
Pin 512 656 fixed;
Pout 448 656 fixed;
end;
implementation eq
parameters
real offset[3]= [0; 0.0325; 0]; //coordinates of joint_1
variables
real Hab[4,4];
real AdHab[6,6];
equations
Hab = homogeneous(eye(3),offset);
AdHab = Adjoint(eye(3),offset);
Hout = Hin * Hab;
Pout.e = transpose(AdHab) * Pin.e;
Pin.f = AdHab * Pout.f;
implementation_end;
Link2 640 680
description '
4.8
Z:\home\wouter\Documents\20-sim\library\Bond Graph\MR\link-v2.emx
1
False
2020-7-16 17:44:32
False
';
type 'Submodel-Equation'
ports
signal in Hin [4,4];
signal out Hout [4,4];
power in Pin [6,1];
power out Pout [6,1];
restrictions
causality constraint not_equal Pin Pout;
end;
icon bg bottom
figures
rectangle 608 640 672 720 color 0 fill 8454041;
text 'name' 640 664 color 0 'Clear Sans' 16;
terminals
Hin 608 704 fixed;
Hout 672 704 fixed;
Pin 672 656 fixed;
Pout 608 656 fixed;
end;
implementation eq
parameters
real offset[3]= [0; 0.025; 0]; //coordinates of joint_1
variables
real Hab[4,4];
real AdHab[6,6];
equations
Hab = homogeneous(eye(3),offset);
AdHab = Adjoint(eye(3),offset);
Hout = Hin * Hab;
Pout.e = transpose(AdHab) * Pin.e;
Pin.f = AdHab * Pout.f;
implementation_end;
Link3 832 680
description '
4.8
Z:\home\wouter\Documents\20-sim\library\Bond Graph\MR\link-v2.emx
1
False
2020-7-16 17:44:32
False
';
type 'Submodel-Equation'
ports
signal in Hin [4,4];
signal out Hout [4,4];
power in Pin [6,1];
power out Pout [6,1];
restrictions
causality constraint not_equal Pin Pout;
end;
icon bg bottom
figures
rectangle 800 640 864 720 color 0 fill 8454041;
text 'name' 832 664 color 0 'Clear Sans' 16;
terminals
Hin 800 704 fixed;
Hout 864 704 fixed;
Pin 864 656 fixed;
Pout 800 656 fixed;
end;
implementation eq
parameters
real offset[3]= [0; 0.025; 0]; //coordinates of joint_1
variables
real Hab[4,4];
real AdHab[6,6];
equations
Hab = homogeneous(eye(3),offset);
AdHab = Adjoint(eye(3),offset);
Hout = Hin * Hab;
Pout.e = transpose(AdHab) * Pin.e;
Pin.f = AdHab * Pout.f;
implementation_end;
MXTF 352.3 288
description '
4.8
1
False
Z:\home\wouter\Documents\20-sim\library\Bond Graph\2D\MXTF-2.emx
2020-7-14 17:06:13
True
';
type 'TF-2'
ports
power in p1;
power out p2 [2,1];
signal in p [2,1];
restrictions
causality constraint not_equal p1 p2;
causality fixed in p2;
causality fixed out p1;
end;
icon bg bottom
figures
text 'MXTF' 352.3 288 color 0 18 bold;
end;
implementation eq
variables
real r[2];
equations
r = [-p[2];p[1]];
p1.e = transpose (r) * p2.e;
p2.f = r * p1.f;implementation_end;
Negate1 224 800
description '4.01False
Signal\Block Diagram\Negate.emx
2007-9-26 12:14:11
';
type Negate
ports
signal in input;
signal out output;
end;
icon bg bottom
figures
rectangle 208 784 240 816 color 0 fill 15132390;
text '-1' 224 800 color 16711680 16 bold;
end;
implementation eq
equations
output = - input;
implementation_end;
Negate2 592 800
description '4.01False
Signal\Block Diagram\Negate.emx
2007-9-26 12:14:11
';
type Negate
ports
signal in input;
signal out output;
end;
icon bg bottom
figures
rectangle 576 784 608 816 color 0 fill 15132390;
text '-1' 592 800 color 16711680 16 bold;
end;
implementation eq
equations
output = - input;
implementation_end;
new_joint1 424 768
description '4.0
Template\Submodel-Equation.emx
1
False
2007-11-1 22:32:1
False
';
type 'Submodel-Equation'
ports
signal in input [4,4];
signal out output;
end;
implementation eq
variables
real position[3];
real rotation[3];
real R[3,3];
equations
position = input[1:3,4];
rotation = dll('EulerAngles.dll','EulXYZsFromHMatrix',input);
//[input[3,2];input[1,3];input[2,1]];
R = input[1:3,1:3];implementation_end;
new_joint2 776 768
description '4.0
Template\Submodel-Equation.emx
1
False
2007-11-1 22:32:1
False
';
type 'Submodel-Equation'
ports
signal in input [4,4];
signal out output;
end;
implementation eq
variables
real position[3];
real rotation[3];
real R[3,3];
equations
// start typing here
position = input[1:3,4];
rotation = [input[3,2];input[1,3];input[2,1]];
R = input[1:3,1:3];implementation_end;
new_joint3 1040 704
description '4.0
Template\Submodel-Equation.emx
1
False
2007-11-1 22:32:1
False
';
type 'Submodel-Equation'
ports
signal in input [4,4];
signal out output;
end;
implementation eq
variables
real position[3];
real rotation[3];
real R[3,3];
equations
position = input[1:3,4];
rotation = [input[3,2];input[1,3];input[2,1]];
R = input[1:3,1:3];implementation_end;
OneJunction 424 368
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 424 368 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction1 424 520
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
translation knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 424 520 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction10 824 232
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
rotation knot duplicatable none p [1];
signal knot out flow [1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 824 232 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction11 984 512
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 984 512 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction12 704 368
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 704 368 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction16 624 200
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
rotation knot duplicatable none p [1];
signal knot out flow [1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 624 200 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction17 560 752
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [1];
signal knot out flow [1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 560 752 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction18 248 208
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
rotation knot duplicatable none p [1];
signal knot out flow [1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 248 208 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction2 128 656
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [6,1];
signal knot out flow [6,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 128 656 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction3 432 232
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
rotation knot duplicatable none p [1];
signal knot out flow [1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 432 232 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction5 272.3 368
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 272.3 368 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction6 272 520
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 272 520 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction7 824 368
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 824 368 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction8 824 520
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 824 520 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
OneJunction9 984 368
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [2,1];
signal knot out flow [2,1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 984 368 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
PID 248 88
description '
4.0
1
False
Signal\Control\PID Control\Continuous\PID.emx
2008-1-17 10:49:30
';
type PID
ports
signal in error;
signal out output;
end;
icon bg bottom
figures
rectangle 232 72 264 104 color 0 fill 15132390;
text 'PID' 248 87.5 color 16711680 18 bold;
end;
implementation eq
parameters
real kp = 0.05 {}; // Proportional gain
real tauD = 1.0 {s}; // Derivative time constant: tauD > 0
real beta = 0.001 {}; // Tameness constant: 0 < beta << 1
real tauI = 0.05{s}; // Integral time constant: tauI > 0
variables
real pdout, pdrate, pdstate;
real pirate, pistate;
equations
pdrate = (kp * error - pdout) / (beta * tauD);
pdstate = int (pdrate);
pdout = pdstate + (kp * error / beta);
pirate = pdout / tauI;
pistate = int (pirate);
output = pistate + pdout;
implementation_end;
PID1 624 88
description '
4.0
1
False
Signal\Control\PID Control\Continuous\PID.emx
2008-1-17 10:49:30
';
type PID
ports
signal in error;
signal out output;
end;
icon bg bottom
figures
rectangle 608 72 640 104 color 0 fill 15132390;
text 'PID' 624 87.5 color 16711680 18 bold;
end;
implementation eq
parameters
real kp = 0.02 {}; // Proportional gain
real tauD = 1.0 {s}; // Derivative time constant: tauD > 0
real beta = 0.001 {}; // Tameness constant: 0 < beta << 1
real tauI = 0.05 {s}; // Integral time constant: tauI > 0
variables
real pdout, pdrate, pdstate;
real pirate, pistate;
equations
pdrate = (kp * error - pdout) / (beta * tauD);
pdstate = int (pdrate);
pdout = pdstate + (kp * error / beta);
pirate = pdout / tauI;
pistate = int (pirate);
output = pistate + pdout;
implementation_end;
PID2 280 800
description '
4.0
1
False
Signal\Control\PID Control\Continuous\PID.emx
2008-1-17 10:49:30
';
type PID
ports
signal in error;
signal out output;
end;
icon bg bottom
figures
rectangle 264 784 296 816 color 0 fill 15132390;
text 'PID' 280 799.5 color 16711680 18 bold;
end;
implementation eq
parameters
real kp = 0.05 {}; // Proportional gain
real tauD = 1.0 {s}; // Derivative time constant: tauD > 0
real beta = 0.001 {}; // Tameness constant: 0 < beta << 1
real tauI = 0.05{s}; // Integral time constant: tauI > 0
variables
real pdout, pdrate, pdstate;
real pirate, pistate;
equations
pdrate = (kp * error - pdout) / (beta * tauD);
pdstate = int (pdrate);
pdout = pdstate + (kp * error / beta);
pirate = pdout / tauI;
pistate = int (pirate);
output = pistate + pdout;
implementation_end;
PID3 640 800
description '
4.0
1
False
Signal\Control\PID Control\Continuous\PID.emx
2008-1-17 10:49:30
';
type PID
ports
signal in error;
signal out output;
end;
icon bg bottom
figures
rectangle 624 784 656 816 color 0 fill 15132390;
text 'PID' 640 799.5 color 16711680 18 bold;
end;
implementation eq
parameters
real kp = 0.02 {}; // Proportional gain
real tauD = 1.0 {s}; // Derivative time constant: tauD > 0
real beta = 0.001 {}; // Tameness constant: 0 < beta << 1
real tauI = 0.05 {s}; // Integral time constant: tauI > 0
variables
real pdout, pdrate, pdstate;
real pirate, pistate;
equations
pdrate = (kp * error - pdout) / (beta * tauD);
pdstate = int (pdrate);
pdout = pdstate + (kp * error / beta);
pirate = pdout / tauI;
pistate = int (pirate);
output = pistate + pdout;
implementation_end;
PlusMinus1 584 400
description '4.01False
Signal\Block Diagram\PlusMinus.emx
2007-9-27 10:15:13
';
knot PlusMinus
ports
signal knot duplicatable in plus [1];
signal knot duplicatable in minus [1];
signal knot out output [1];
end;
icon bg ellipse
figures
ellipse 576 392 592 408 color 0 fill 16777215;
end;
implementation eq
equations
output = sum (collect (plus)) - sum (collect (minus));
implementation_end;
PlusMinus2 304 88
description '4.01False
Signal\Block Diagram\PlusMinus.emx
2007-9-27 10:15:13
';
knot PlusMinus
ports
signal knot duplicatable in plus [1];
signal knot duplicatable in minus [1];
signal knot out output [1];
end;
icon bg ellipse
figures
ellipse 296 80 312 96 color 0 fill 16777215;
end;
implementation eq
equations
output = sum (collect (plus)) - sum (collect (minus));
implementation_end;
PlusMinus3 552 88
description '4.01False
Signal\Block Diagram\PlusMinus.emx
2007-9-27 10:15:13
';
knot PlusMinus
ports
signal knot duplicatable in plus [1];
signal knot duplicatable in minus [1];
signal knot out output [1];
end;
icon bg ellipse
figures
ellipse 544 80 560 96 color 0 fill 16777215;
end;
implementation eq
equations
output = sum (collect (plus)) - sum (collect (minus));
implementation_end;
PlusMinus4 328 800
description '4.01False
Signal\Block Diagram\PlusMinus.emx
2007-9-27 10:15:13
';
knot PlusMinus
ports
signal knot duplicatable in plus [1];
signal knot duplicatable in minus [1];
signal knot out output [1];
end;
icon bg ellipse
figures
ellipse 320 792 336 808 color 0 fill 16777215;
end;
implementation eq
equations
output = sum (collect (plus)) - sum (collect (minus));
implementation_end;
PlusMinus5 688 800
description '4.01False
Signal\Block Diagram\PlusMinus.emx
2007-9-27 10:15:13
';
knot PlusMinus
ports
signal knot duplicatable in plus [1];
signal knot duplicatable in minus [1];
signal knot out output [1];
end;
icon bg ellipse
figures
ellipse 680 792 696 808 color 0 fill 16777215;
end;
implementation eq
equations
output = sum (collect (plus)) - sum (collect (minus));
implementation_end;
R 240 752
description '
4.2
1
False
Bond Graph\R.emx
2011-11-29 16:35:37
';
type R
ports
power in p;
end;
icon bg bottom
figures
text 'R' 240 752 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.01;
equations
p.e = r * p.f;
implementation_end;
R1 592 752
description '
4.2
1
False
Bond Graph\R.emx
2011-11-29 16:35:37
';
type R
ports
power in p;
end;
icon bg bottom
figures
text 'R' 592 752 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.01;
equations
p.e = r * p.f;
implementation_end;
R2 200 208
description '
4.2
1
False
Bond Graph\R.emx
2011-11-29 16:35:37
';
type R
ports
power in p;
end;
icon bg bottom
figures
text 'R' 200 208 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.01;
equations
p.e = r * p.f;
implementation_end;
R3 584 200
description '
4.2
1
False
Bond Graph\R.emx
2011-11-29 16:35:37
';
type R
ports
power in p;
end;
icon bg bottom
figures
text 'R' 584 200 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.01;
equations
p.e = r * p.f;
implementation_end;
rectanglepath 64 32
description '
4.8
setpoint\rectanglepath.emx
1
False
2020-7-10 12:30:38
False
';
type 'Submodel-Equation'
ports
signal out output [2,1];
end;
implementation eq
/*
This will generate coordinates for the box that has to be drawn
*/
parameters
real w = 0.07{m} ;
real h = 0.05 {m};
real t = 0.5 {s};
real origin[2] = [0.01,0.03]{m};
variables
real v {m/s};
real t_w {s};
real t_h {s};
real period {s};
real test1, test2, test3;
initialequations
v = (2*w + 2*h)/t;
t_w = w / v;
t_h = h / v;
equations
period = floor(time / t) * t;
output[1] = v*(ramp(period+t_h) - ramp(period + t_w+t_h) - ramp(period + t_w + t_h + t_h)) + origin[1];
output[2] = v*(ramp(period) - ramp(period + t_h) - ramp(period + t_h + t_w) + ramp(period + 2 * t_h + t_w))+ origin[2];
implementation_end;
RTF 424 456
description '
4.8
1
False
Bond Graph\2D\RTF-2.emx
2020-7-14 12:43:04
';
type 'TF-2'
ports
power in p1 [2,1];
power out p2 [2,1];
signal in angle {rad} ;
restrictions
causality constraint not_equal p1 p2;
end;
icon bg bottom
figures
text 'RTF' 424 456 color 0 18 bold;
end;
implementation eq
/*
2D rotation transformer. Takes an angle as input and then rotates the dimensions
*/
variables
real r[2,2];
equations
r = [cos(angle), -sin(angle); sin(angle), cos(angle)];
p1.e = transpose (r) * p2.e;
p2.f = r * p1.f;
implementation_end;
RTF1 584 368
description '
4.8
1
False
Bond Graph\2D\RTF-2.emx
2020-7-14 12:43:04
';
type 'TF-2'
ports
power in p1 [2,1];
power out p2 [2,1];
signal in angle {rad} ;
restrictions
causality constraint not_equal p1 p2;
end;
icon bg bottom
figures
text 'RTF' 584 368 color 0 18 bold;
end;
implementation eq
/*
2D rotation transformer. Takes an angle as input and then rotates the dimensions
*/
variables
real r[2,2];
equations
r = [cos(angle), -sin(angle); sin(angle), cos(angle)];
p1.e = transpose (r) * p2.e;
p2.f = r * p1.f;
implementation_end;
RTF2 272 432
description '
4.8
1
False
Bond Graph\2D\RTF-2.emx
2020-7-14 12:43:04
';
type 'TF-2'
ports
power in p1 [2,1];
power out p2 [2,1];
signal in angle {rad} ;
restrictions
causality constraint not_equal p1 p2;
end;
icon bg bottom
figures
text 'RTF' 272 432 color 0 18 bold;
end;
implementation eq
/*
2D rotation transformer. Takes an angle as input and then rotates the dimensions
*/
variables
real r[2,2];
equations
r = [cos(angle), -sin(angle); sin(angle), cos(angle)];
p1.e = transpose (r) * p2.e;
p2.f = r * p1.f;
implementation_end;
RTF3 824 432
description '
4.8
1
False
Bond Graph\2D\RTF-2.emx
2020-7-14 12:43:04
';
type 'TF-2'
ports
power in p1 [2,1];
power out p2 [2,1];
signal in angle {rad} ;
restrictions
causality constraint not_equal p1 p2;
end;
icon bg bottom
figures
text 'RTF' 824 432 color 0 18 bold;
end;
implementation eq
/*
2D rotation transformer. Takes an angle as input and then rotates the dimensions
*/
variables
real r[2,2];
equations
r = [cos(angle), -sin(angle); sin(angle), cos(angle)];
p1.e = transpose (r) * p2.e;
p2.f = r * p1.f;
implementation_end;
RTF4 984 424
description '
4.8
1
False
Bond Graph\2D\RTF-2.emx
2020-7-14 12:43:04
';
type 'TF-2'
ports
power in p1 [2,1];
power out p2 [2,1];
signal in angle {rad} ;
restrictions
causality constraint not_equal p1 p2;
end;
icon bg bottom
figures
text 'RTF' 984 424 color 0 18 bold;
end;
implementation eq
/*
2D rotation transformer. Takes an angle as input and then rotates the dimensions
*/
variables
real r[2,2];
equations
r = [cos(angle), -sin(angle); sin(angle), cos(angle)];
p1.e = transpose (r) * p2.e;
p2.f = r * p1.f;
implementation_end;
Se 984 656
description '
4.2
1
False
Bond Graph\Se.emx
2011-11-29 16:36:49
';
type Se
ports
power out p [6,1];
restrictions
causality fixed out p;
end;
icon bg bottom
figures
text 'Se' 984 656 color 0 18 bold;
end;
implementation eq
parameters
real effort[6] = 0;
variables
real flow[6];
equations
p.e = effort;
flow = p.f;
implementation_end;
Sf 192 520
description '4.01False
Bond Graph\2D\Sf-2.emx
2007-9-25 12:7:5
';
type 'Sf-2'
ports
power out p [2,1];
restrictions
causality fixed in p;
end;
icon bg bottom
figures
text 'Sf' 192 520 color 0 18 bold;
end;
implementation eq
parameters
real flow[2,1] = [0.0; 0.0];
variables
real effort [2];
equations
p.f = flow;
effort = p.e;
implementation_end;
Sf1 152 232
description '
4.2
1
False
Bond Graph\Sf.emx
2011-11-29 16:38:03
';
type Sf
ports
power out p;
restrictions
causality fixed in p;
end;
icon bg bottom
figures
text 'Sf' 152 232 color 0 18 bold;
end;
implementation eq
parameters
real flow = 0;
variables
real effort;
equations
p.f = flow;
effort = p.e;
implementation_end;
Sf2 72 656
description '4.01False
Bond Graph\2D\Sf-2.emx
2007-9-25 12:7:5
';
type 'Sf-2'
ports
power out p [6,1];
restrictions
causality fixed in p;
end;
icon bg bottom
figures
text 'Sf' 72 656 color 0 18 bold;
end;
implementation eq
parameters
real flow[6,1] = 0;
variables
real effort [6];
equations
p.f = flow;
effort = p.e;
implementation_end;
Sine 440 24
description '4.01False
Signal\Sources\WaveGenerator-Sine.emx
2007-9-27 16:12:6
';
type 'WaveGenerator-Sine'
ports
signal out output;
end;
icon bg bottom
figures
group
rectangle 424 8 456 40 color 0 fill 15132390;
line 428.5 14.4 428.5 33.6 color 0;
line 454.1 24 425.3 24 color 0;
spline 428.9 23.9 432.1 15.8 435.3 23.9 438.6 32 441.7 23.9 444.8 15.8 448.1 23.9 451.6 32.2 454.8 24.2 color 16711680;
end;
end;
implementation eq
parameters
real amplitude = 1.0; // amplitude of the wave
real omega = 1.0 {rad/s}; // angular frequency of the wave
variables
boolean hidden change;
real hidden half;
equations
"calculate at least 2 points per cycle to get a triangle"
half = pi / omega;
change = frequencyevent (half, half / 2);
"calculate the sine wave"
output = amplitude * sin ( omega * time);
implementation_end;
Splitter1 384 400
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [1];
signal knot in input [1];
end;
icon bg ellipse
figures
ellipse 380.8 396.8 387.2 403.2 color -1 fill 0;
ellipse 379.7 395.7 388.3 404.3 color -1;
terminals
input 384 400 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Splitter2 800 400
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [1];
signal knot in input [1];
end;
icon bg ellipse
figures
ellipse 796.8 396.8 803.2 403.2 color -1 fill 0;
ellipse 795.7 395.7 804.3 404.3 color -1;
terminals
input 800 400 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Splitter3 304 400
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [1];
signal knot in input [1];
end;
icon bg ellipse
figures
ellipse 300.8 396.8 307.2 403.2 color -1 fill 0;
ellipse 299.7 395.7 308.3 404.3 color -1;
terminals
input 304 400 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Splitter4 632 400
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [1];
signal knot in input [1];
end;
icon bg ellipse
figures
ellipse 628.8 396.8 635.2 403.2 color -1 fill 0;
ellipse 627.7 395.7 636.3 404.3 color -1;
terminals
input 632 400 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Splitter5 776 704
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [4,4];
signal knot in input [4,4];
end;
icon bg ellipse
figures
ellipse 772.8 700.8 779.2 707.2 color -1 fill 0;
ellipse 771.7 699.7 780.3 708.3 color -1;
terminals
input 776 704 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Splitter6 424 704
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [4,4];
signal knot in input [4,4];
end;
icon bg ellipse
figures
ellipse 420.8 700.8 427.2 707.2 color -1 fill 0;
ellipse 419.7 699.7 428.3 708.3 color -1;
terminals
input 424 704 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Splitter7 160 32
description '4.0
Signal\Block Diagram\Splitter.emx
2008-01-17 11:28:29
1
False
';
knot Splitter
ports
signal knot duplicatable out output [2,1];
signal knot in input [2,1];
end;
icon bg ellipse
figures
ellipse 156.8 28.8 163.2 35.2 color -1 fill 0;
ellipse 155.7 27.7 164.3 36.3 color -1;
terminals
input 160 32 fixed;
end;
implementation eq
equations
collect (output) = input;
implementation_end;
Submodel1 248 168
description '
4.8
1
';
type Submodel
ports
signal in input;
power out p2;
end;
implementation bg
submodels
Gain1 552 88
description '4.01False
Signal\Block Diagram\Gain.emx
2007-9-26 12:15:12
';
type Gain
ports
signal in input;
signal out output;
end;
icon bg bottom
figures
rectangle 536.1 72 567.9 104 color 0 fill 15132390;
text 'K' 552 88 color 16711680 16 bold;
end;
implementation eq
parameters
real K = 12.0; // gain
equations
output = K * input;
implementation_end;
GY 624 184
description '
4.2
1
False
Bond Graph\GY.emx
2011-11-29 15:53:45
';
type GY
ports
power in p1;
power out p2;
restrictions
causality constraint equal p1 p2;
end;
icon bg bottom
figures
text 'GY' 624 184 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.127;
equations
p1.e = r * p2.f;
p2.e = r * p1.f;
implementation_end;
MSe 624 88
description '
4.2
1
False
Bond Graph\MSe.emx
2011-11-29 16:12:33
';
type MSe
ports
power out p;
signal in effort;
restrictions
causality fixed out p;
end;
icon bg bottom
figures
text 'MSe' 624 88 color 0 18 bold;
end;
implementation eq
variables
real flow;
equations
p.e = effort;
flow = p.f;
implementation_end;
plug input 424 88;
plug p2 624 220;
OneJunction2 624 136
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [1];
signal knot out flow [1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 624 136 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
R 664 136
description '
4.2
1
False
Bond Graph\R.emx
2011-11-29 16:35:37
';
type R
ports
power in p;
end;
icon bg bottom
figures
text 'R' 664 136 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.08;
equations
p.e = r * p.f;
implementation_end;
SignalLimiter2 488 88
description '4.01False
Signal\Block Diagram Non-Linear\SignalLimiter-Limit.emx
2007-9-26 12:47:40
';
type 'SignalLimiter-Limit'
ports
signal in input;
signal out output;
end;
icon bg bottom
figures
group
rectangle 472 72 504 104 color 0 fill 15132390;
line 487.9 76.5 487.9 101 color 0 fill 15132390;
line 475 88.2 500.7 88.2 color 0 fill 15132390;
spline 481.9 95.1 493.9 81.4 color 16711680 fill 15132390 width 2;
spline 493.3 82.2 501.9 81.8 color 16711680 fill 15132390 width 2;
spline 475 95.6 481.9 95.1 color 16711680 fill 15132390 width 2;
end;
end;
implementation eq
parameters
real maximum = 1;
real minimum = -1;
equations
output = limit (input, minimum, maximum);
implementation_end;
end;
connections
Gain1\output -> MSe\effort;
GY\p2 => p2;
input -> SignalLimiter2\input;
MSe\p => OneJunction2\p;
OneJunction2\p => GY\p1;
R\p <= OneJunction2\p;
SignalLimiter2\output -> Gain1\input;
end;
implementation_end;
Submodel2 144 800
description '
4.8
1
';
type Submodel
ports
signal in input;
power out p2;
end;
implementation bg
submodels
Gain1 552 88
description '4.01False
Signal\Block Diagram\Gain.emx
2007-9-26 12:15:12
';
type Gain
ports
signal in input;
signal out output;
end;
icon bg bottom
figures
rectangle 536.1 72 567.9 104 color 0 fill 15132390;
text 'K' 552 88 color 16711680 16 bold;
end;
implementation eq
parameters
real K = 12.0; // gain
equations
output = K * input;
implementation_end;
GY 624 184
description '
4.2
1
False
Bond Graph\GY.emx
2011-11-29 15:53:45
';
type GY
ports
power in p1;
power out p2;
restrictions
causality constraint equal p1 p2;
end;
icon bg bottom
figures
text 'GY' 624 184 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.127;
equations
p1.e = r * p2.f;
p2.e = r * p1.f;
implementation_end;
MSe 624 88
description '
4.2
1
False
Bond Graph\MSe.emx
2011-11-29 16:12:33
';
type MSe
ports
power out p;
signal in effort;
restrictions
causality fixed out p;
end;
icon bg bottom
figures
text 'MSe' 624 88 color 0 18 bold;
end;
implementation eq
variables
real flow;
equations
p.e = effort;
flow = p.f;
implementation_end;
plug input 424 88;
plug p2 624 220;
OneJunction2 624 136
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [1];
signal knot out flow [1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 624 136 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
R 664 136
description '
4.2
1
False
Bond Graph\R.emx
2011-11-29 16:35:37
';
type R
ports
power in p;
end;
icon bg bottom
figures
text 'R' 664 136 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.08;
equations
p.e = r * p.f;
implementation_end;
SignalLimiter2 488 88
description '4.01False
Signal\Block Diagram Non-Linear\SignalLimiter-Limit.emx
2007-9-26 12:47:40
';
type 'SignalLimiter-Limit'
ports
signal in input;
signal out output;
end;
icon bg bottom
figures
group
rectangle 472 72 504 104 color 0 fill 15132390;
line 487.9 76.5 487.9 101 color 0 fill 15132390;
line 475 88.2 500.7 88.2 color 0 fill 15132390;
spline 481.9 95.1 493.9 81.4 color 16711680 fill 15132390 width 2;
spline 493.3 82.2 501.9 81.8 color 16711680 fill 15132390 width 2;
spline 475 95.6 481.9 95.1 color 16711680 fill 15132390 width 2;
end;
end;
implementation eq
parameters
real maximum = 1;
real minimum = -1;
equations
output = limit (input, minimum, maximum);
implementation_end;
end;
connections
Gain1\output -> MSe\effort;
GY\p2 => p2;
input -> SignalLimiter2\input;
MSe\p => OneJunction2\p;
OneJunction2\p => GY\p1;
R\p <= OneJunction2\p;
SignalLimiter2\output -> Gain1\input;
end;
implementation_end;
Submodel3 352 480
description '4.0
Template\Submodel-Equation.emx
1
False
2007-11-1 22:32:1
False
';
type 'Submodel-Equation'
ports
signal in angle_velocity {rad/s} ;
signal out angle {rad} ;
signal in velocity [2,1] {m/s} ;
signal out position [2,1] {m} ;
signal out mass {kg} ;
signal out angular_momentum {N.m.s} ;
signal out joint1 [2,1];
signal out joint2 [2,1];
end;
implementation eq
/* Equation Submodel
Enter your equations here. You can use the Toolbar buttons at the top ( Add , f(x) etc. ).
*/
parameters
real density = 1400 {kg/m3};
real dimension[3] = [0.005;0.065;0.01] {m};
real initial_position[2] = [0.0325;0] {m};
real initial_angle = 0 {rad};
variables
real body_angle[3];
real body_position[3];
real body_size[3];
real moment[3];
initialequations
mass = dimension[1] * dimension[2] * dimension[3] * density;
moment[1] = mass/12 * ( dimension[2]^2 + dimension[3]^2);
moment[2] = mass/12 * ( dimension[1]^2 + dimension[3]^2);
moment[3] = mass/12 * ( dimension[1]^2 + dimension[2]^2);
angular_momentum = moment[1];
equations
angle = int(angle_velocity,initial_angle);
body_angle = [angle;0;0];
position = int(velocity,initial_position);
body_position = [0; position[1];position[2]];
joint1=[-dimension[2]/2;0];
joint2=[dimension[2]/2;0];
implementation_end;
Submodel4 744 480
description '4.0
Template\Submodel-Equation.emx
1
False
2007-11-1 22:32:1
False
';
type 'Submodel-Equation'
ports
signal in angle_velocity {rad/s} ;
signal out angle {rad} ;
signal in velocity [2,1] {m/s} ;
signal out position [2,1] {m} ;
signal out mass {kg} ;
signal out angular_momentum {N.m.s} ;
signal out joint1 [2,1];
signal out joint2 [2,1];
end;
icon bg
figures
rectangle 704 464 784 496 color 0 fill 15132390;
text 'name' 744 480 color 0 16;
end;
implementation eq
/* Equation Submodel
Enter your equations here. You can use the Toolbar buttons at the top ( Add , f(x) etc. ).
*/
parameters
real density = 1400 {kg/m3};
real dimension[3] = [0.005;0.05;0.01] {m};
real initial_position[2] = [0.09;0.0] {m};
real initial_angle = 0.0 {rad};
variables
real body_angle[3];
real body_position[3];
real body_size[3];
real moment[3];
initialequations
mass = dimension[1] * dimension[2] * dimension[3] * density;
moment[1] = mass/12 * ( dimension[2]^2 + dimension[3]^2);
moment[2] = mass/12 * ( dimension[1]^2 + dimension[3]^2);
moment[3] = mass/12 * ( dimension[1]^2 + dimension[2]^2);
angular_momentum = moment[1];
equations
angle = int(angle_velocity,initial_angle);
body_angle = [angle;0;0];
position = int(velocity,initial_position);
body_position = [0; position[1];position[2]];
joint1=[-dimension[2]/2;0];
joint2=[dimension[2]/2;0];implementation_end;
Submodel5 520 800
description '
4.8
1
';
type Submodel
ports
signal in input;
power out p2;
end;
implementation bg
submodels
Gain1 552 88
description '4.01False
Signal\Block Diagram\Gain.emx
2007-9-26 12:15:12
';
type Gain
ports
signal in input;
signal out output;
end;
icon bg bottom
figures
rectangle 536.1 72 567.9 104 color 0 fill 15132390;
text 'K' 552 88 color 16711680 16 bold;
end;
implementation eq
parameters
real K = 12.0; // gain
equations
output = K * input;
implementation_end;
GY 624 184
description '
4.2
1
False
Bond Graph\GY.emx
2011-11-29 15:53:45
';
type GY
ports
power in p1;
power out p2;
restrictions
causality constraint equal p1 p2;
end;
icon bg bottom
figures
text 'GY' 624 184 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.127;
equations
p1.e = r * p2.f;
p2.e = r * p1.f;
implementation_end;
MSe 624 88
description '
4.2
1
False
Bond Graph\MSe.emx
2011-11-29 16:12:33
';
type MSe
ports
power out p;
signal in effort;
restrictions
causality fixed out p;
end;
icon bg bottom
figures
text 'MSe' 624 88 color 0 18 bold;
end;
implementation eq
variables
real flow;
equations
p.e = effort;
flow = p.f;
implementation_end;
plug input 424 88;
plug p2 624 220;
OneJunction2 624 136
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [1];
signal knot out flow [1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 624 136 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
R 664 136
description '
4.2
1
False
Bond Graph\R.emx
2011-11-29 16:35:37
';
type R
ports
power in p;
end;
icon bg bottom
figures
text 'R' 664 136 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.08;
equations
p.e = r * p.f;
implementation_end;
SignalLimiter2 488 88
description '4.01False
Signal\Block Diagram Non-Linear\SignalLimiter-Limit.emx
2007-9-26 12:47:40
';
type 'SignalLimiter-Limit'
ports
signal in input;
signal out output;
end;
icon bg bottom
figures
group
rectangle 472 72 504 104 color 0 fill 15132390;
line 487.9 76.5 487.9 101 color 0 fill 15132390;
line 475 88.2 500.7 88.2 color 0 fill 15132390;
spline 481.9 95.1 493.9 81.4 color 16711680 fill 15132390 width 2;
spline 493.3 82.2 501.9 81.8 color 16711680 fill 15132390 width 2;
spline 475 95.6 481.9 95.1 color 16711680 fill 15132390 width 2;
end;
end;
implementation eq
parameters
real maximum = 1;
real minimum = -1;
equations
output = limit (input, minimum, maximum);
implementation_end;
end;
connections
Gain1\output -> MSe\effort;
GY\p2 => p2;
input -> SignalLimiter2\input;
MSe\p => OneJunction2\p;
OneJunction2\p => GY\p1;
R\p <= OneJunction2\p;
SignalLimiter2\output -> Gain1\input;
end;
implementation_end;
Submodel8 624 160
description '
4.8
1
';
type Submodel
ports
signal in input;
power out p2;
end;
implementation bg
submodels
Gain1 552 88
description '4.01False
Signal\Block Diagram\Gain.emx
2007-9-26 12:15:12
';
type Gain
ports
signal in input;
signal out output;
end;
icon bg bottom
figures
rectangle 536.1 72 567.9 104 color 0 fill 15132390;
text 'K' 552 88 color 16711680 16 bold;
end;
implementation eq
parameters
real K = 12.0; // gain
equations
output = K * input;
implementation_end;
GY 624 192
description '
4.2
1
False
Bond Graph\GY.emx
2011-11-29 15:53:45
';
type GY
ports
power in p1;
power out p2;
restrictions
causality constraint equal p1 p2;
end;
icon bg bottom
figures
text 'GY' 624 192 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.127;
equations
p1.e = r * p2.f;
p2.e = r * p1.f;
implementation_end;
MSe 624 88
description '
4.2
1
False
Bond Graph\MSe.emx
2011-11-29 16:12:33
';
type MSe
ports
power out p;
signal in effort;
restrictions
causality fixed out p;
end;
icon bg bottom
figures
text 'MSe' 624 88 color 0 18 bold;
end;
implementation eq
variables
real flow;
equations
p.e = effort;
flow = p.f;
implementation_end;
plug input 424 88;
plug p2 624 280;
OneJunction2 624 144
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [1];
signal knot out flow [1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 624 144 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
R 672 144
description '
4.2
1
False
Bond Graph\R.emx
2011-11-29 16:35:37
';
type R
ports
power in p;
end;
icon bg bottom
figures
text 'R' 672 144 color 0 18 bold;
end;
implementation eq
parameters
real r = 0.08;
equations
p.e = r * p.f;
implementation_end;
SignalLimiter2 488 88
description '4.01False
Signal\Block Diagram Non-Linear\SignalLimiter-Limit.emx
2007-9-26 12:47:40
';
type 'SignalLimiter-Limit'
ports
signal in input;
signal out output;
end;
icon bg bottom
figures
group
rectangle 472 72 504 104 color 0 fill 15132390;
line 487.9 76.5 487.9 101 color 0 fill 15132390;
line 475 88.2 500.7 88.2 color 0 fill 15132390;
spline 481.9 95.1 493.9 81.4 color 16711680 fill 15132390 width 2;
spline 493.3 82.2 501.9 81.8 color 16711680 fill 15132390 width 2;
spline 475 95.6 481.9 95.1 color 16711680 fill 15132390 width 2;
end;
end;
implementation eq
parameters
real maximum = 1;
real minimum = -1;
equations
output = limit (input, minimum, maximum);
implementation_end;
end;
connections
Gain1\output -> MSe\effort;
GY\p2 => p2;
input -> SignalLimiter2\input;
MSe\p => OneJunction2\p;
OneJunction2\p => GY\p1;
R\p <= OneJunction2\p;
SignalLimiter2\output -> Gain1\input;
end;
implementation_end;
TF 504 288
description '
4.8
1
False
Z:\home\wouter\Documents\20-sim\library\Bond Graph\2D\MXTF-2.emx
2020-7-14 16:54:28
True
';
type 'TF-2'
ports
power in p1;
power out p2 [2,1];
signal in p [2,1];
restrictions
causality constraint not_equal p1 p2;
causality fixed in p2;
causality fixed out p1;
end;
icon bg bottom
figures
text 'MXTF' 504 288 color 0 18 bold;
end;
implementation eq
variables
real r[2];
equations
r = [-p[2];p[1]];
p1.e = transpose (r) * p2.e;
p2.f = r * p1.f;implementation_end;
TF2 904 288
description '
4.8
1
False
Z:\home\wouter\Documents\20-sim\library\Bond Graph\2D\MXTF-2.emx
2020-7-14 17:06:13
True
';
type 'TF-2'
ports
power in p1;
power out p2 [2,1];
signal in p [2,1];
restrictions
causality constraint not_equal p1 p2;
causality fixed in p2;
causality fixed out p1;
end;
icon bg bottom
figures
text 'MXTF' 904 288 color 0 18 bold;
end;
implementation eq
variables
real r[2];
equations
r = [-p[2];p[1]];
p1.e = transpose (r) * p2.e;
p2.f = r * p1.f;implementation_end;
TF3 808 288
description '
4.8
1
False
Z:\home\wouter\Documents\20-sim\library\Bond Graph\2D\MXTF-2.emx
2020-7-14 16:54:28
True
';
type 'TF-2'
ports
power in p1;
power out p2 [2,1];
signal in p [2,1];
restrictions
causality constraint not_equal p1 p2;
causality fixed in p2;
causality fixed out p1;
end;
icon bg bottom
figures
text 'MXTF' 808 288 color 0 18 bold;
end;
implementation eq
variables
real r[2];
equations
r = [-p[2];p[1]];
p1.e = transpose (r) * p2.e;
p2.f = r * p1.f;implementation_end;
Zero 80 704
description '4.01False
Signal\Sources\Zero.emx
2007-9-27 15:54:36
';
type Zero
ports
signal out output [4,4];
end;
icon bg bottom
figures
rectangle 64.1 688 95.9 720 color 0 fill 15132390;
text '0' 80 704 color 16711680 18 bold;
end;
implementation eq
equations
output = eye(4);implementation_end;
ZeroJunction 504 368
description '
4.2
1
False
Bond Graph\ZeroJunction.emx
2011-11-29 16:45:16
';
knot ZeroJunction
ports
power knot duplicatable none p [2,1];
signal knot out effort [2,1];
restrictions
causality constraint one_in p;
end;
icon bg
figures
text '0' 504 368 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.f)) = 0;
equal (collect (p.e));
effort = first (p.e);
implementation_end;
ZeroJunction1 352.3 368
description '
4.2
1
False
Bond Graph\ZeroJunction.emx
2011-11-29 16:45:16
';
knot ZeroJunction
ports
power knot duplicatable none p [2,1];
signal knot out effort [2,1];
restrictions
causality constraint one_in p;
end;
icon bg
figures
text '0' 352.3 368 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.f)) = 0;
equal (collect (p.e));
effort = first (p.e);
implementation_end;
ZeroJunction2 904 368
description '
4.2
1
False
Bond Graph\ZeroJunction.emx
2011-11-29 16:45:16
';
knot ZeroJunction
ports
power knot duplicatable none p [2,1];
signal knot out effort [2,1];
restrictions
causality constraint one_in p;
end;
icon bg
figures
text '0' 904 368 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.f)) = 0;
equal (collect (p.e));
effort = first (p.e);
implementation_end;
ZeroJunction3 752.3 368
description '
4.2
1
False
Bond Graph\ZeroJunction.emx
2011-11-29 16:45:16
';
knot ZeroJunction
ports
power knot duplicatable none p [2,1];
signal knot out effort [2,1];
restrictions
causality constraint one_in p;
end;
icon bg
figures
text '0' 752.3 368 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.f)) = 0;
equal (collect (p.e));
effort = first (p.e);
implementation_end;
ZeroJunction4 624 232
description '
4.2
1
False
Bond Graph\ZeroJunction.emx
2011-11-29 16:45:16
';
knot ZeroJunction
ports
rotation knot duplicatable none p [1];
signal knot out effort [1];
restrictions
causality constraint one_in p;
end;
icon bg
figures
text '0' 624 232 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.f)) = 0;
equal (collect (p.e));
effort = first (p.e);
implementation_end;
ZeroJunction5 248 232
description '
4.2
1
False
Bond Graph\ZeroJunction.emx
2011-11-29 16:45:16
';
knot ZeroJunction
ports
rotation knot duplicatable none p [1];
signal knot out effort [1];
restrictions
causality constraint one_in p;
end;
icon bg
figures
text '0' 248 232 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.f)) = 0;
equal (collect (p.e));
effort = first (p.e);
implementation_end;
ZeroJunction7 208 752
description '
4.2
1
False
Bond Graph\OneJunction.emx
2011-11-29 16:17:51
';
knot OneJunction
ports
power knot duplicatable none p [1];
signal knot out flow [1];
restrictions
causality constraint one_out p;
end;
icon bg
figures
text '1' 208 752 color 0 18 bold;
end;
implementation eq
equations
sum (direct (p.e)) = 0;
equal (collect (p.f));
flow = first (p.f);
implementation_end;
end;
connections
Base1\Hout -> Splitter5\input;
Base1\p1 <= Link3\Pout;
Base2\Hout -> new_joint3\input;
Base3\Hin <- Link\Hout;
Base3\Hout -> Splitter6\input;
Base3\p1 <= Link1\Pout;
Constant\output -> COM3\mass;
I\p <= OneJunction3\p;
I1\p <= OneJunction10\p;
inverse_kinematics\angle1 -> PlusMinus2\plus;
inverse_kinematics\angle2 -> PlusMinus3\plus;
inverse_kinematics1\angle1 -> PlusMinus4\plus;
inverse_kinematics1\angle2 -> PlusMinus5\plus 656 864;
Joint1\Hout -> Link\Hin;
Joint1\p => OneJunction2\p;
Joint1\p2 <= Link\Pout;
Joint1\q -> PlusMinus4\minus 280 752;
Joint2\Hout -> Link2\Hin;
Joint2\p2 <= Link2\Pout;
Joint2\q -> PlusMinus5\minus 608 752;
Link\Pin <= Base3\p;
Link1\Hout -> Joint2\Hin;
Link1\Pin <= Joint2\p;
Link2\Hout -> Base1\Hin;
Link2\Pin <= Base1\p;
Link3\Hout -> Base2\Hin;
Link3\Pin <= Base2\p;
MXTF\p2 => ZeroJunction1\p;
Negate1\output -> Submodel2\input;
Negate2\output -> Submodel5\input;
OneJunction\p => RTF\p1;
OneJunction\p => ZeroJunction\p;
OneJunction\p => ZeroJunction1\p;
OneJunction1\flow -> Submodel3\velocity 344 520;
OneJunction1\p => COM1\p;
OneJunction10\flow -> Submodel4\angle_velocity 728 288 728 424;
OneJunction10\p => TF2\p1;
OneJunction10\p => TF3\p1;
OneJunction11\flow -> Integrate\input;
OneJunction11\p => COM3\p;
OneJunction16\flow -> Integrate1\input;
OneJunction16\p => ZeroJunction4\p;
OneJunction17\p => Joint2\p1;
OneJunction18\p => ZeroJunction5\p;
OneJunction3\flow -> Submodel3\angle_velocity 328 264 328 440;
OneJunction3\p => MXTF\p1;
OneJunction3\p => TF\p1;
OneJunction3\p => ZeroJunction4\p;
OneJunction5\p => RTF2\p1;
OneJunction7\p => RTF3\p1;
OneJunction7\p => ZeroJunction2\p;
OneJunction7\p => ZeroJunction3\p;
OneJunction8\flow -> Submodel4\velocity 744 520;
OneJunction8\p => COM2\p;
OneJunction9\p => RTF4\p1;
PID\output -> Submodel1\input;
PID2\output -> Negate1\input;
PID3\output -> Negate2\input;
PlusMinus1\output -> RTF1\angle;
PlusMinus2\output -> PID\error;
PlusMinus3\output -> PID1\error;
PlusMinus4\output -> PID2\error;
PlusMinus5\output -> PID3\error;
R\p <= ZeroJunction7\p;
R1\p <= OneJunction17\p;
R2\p <= OneJunction18\p;
R3\p <= OneJunction16\p;
rectanglepath\output -> Splitter7\input;
RTF\p2 => OneJunction1\p;
RTF1\p2 => OneJunction12\p;
RTF2\p2 => OneJunction6\p;
RTF3\p2 => OneJunction8\p;
RTF4\p2 => OneJunction11\p;
Se\p => Base2\p1;
Sf\p => OneJunction6\p;
Sf1\p => ZeroJunction5\p;
Sf2\p => OneJunction2\p;
Splitter1\output -> PlusMinus1\plus;
Splitter1\output -> RTF\angle 400 416 400 432;
Splitter1\output -> Splitter3\input;
Splitter2\output -> RTF3\angle 800 408;
Splitter2\output -> RTF4\angle 952 400;
Splitter2\output -> Splitter4\input;
Splitter3\output -> PlusMinus2\minus 304 160;
Splitter3\output -> RTF2\angle 296 400;
Splitter4\output -> PlusMinus1\minus;
Splitter4\output -> PlusMinus3\minus 632 344 552 288;
Splitter5\output -> Link3\Hin;
Splitter5\output -> new_joint2\input;
Splitter6\output -> Link1\Hin;
Splitter6\output -> new_joint1\input;
Splitter7\output -> inverse_kinematics\input;
Splitter7\output -> inverse_kinematics1\input 32 680 32 864;
Submodel1\p2 => OneJunction18\p;
Submodel2\p2 => ZeroJunction7\p;
Submodel3\angle -> Splitter1\input 368 448 368 416;
Submodel3\angular_momentum -> I\i 320 440 320 264;
Submodel3\joint1 -> MXTF\p 392 320;
Submodel3\joint2 -> TF\p;
Submodel3\mass -> COM1\mass 336 528 416 528 416 568;
Submodel4\angle -> Splitter2\input;
Submodel4\angular_momentum -> I1\i 720 424 720 288;
Submodel4\joint1 -> TF3\p;
Submodel4\joint2 -> TF2\p;
Submodel4\mass -> COM2\mass 736 528 736 584;
Submodel5\p2 => OneJunction17\p;
Submodel8\input <- PID1\output;
Submodel8\p2 => OneJunction16\p;
TF\p2 => ZeroJunction\p;
TF2\p2 => ZeroJunction2\p;
TF3\p2 => ZeroJunction3\p;
Zero\output -> Joint1\Hin;
ZeroJunction\p => RTF1\p1;
ZeroJunction1\p => OneJunction5\p;
ZeroJunction2\p => OneJunction9\p;
ZeroJunction3\p => OneJunction12\p;
ZeroJunction4\p => OneJunction10\p;
ZeroJunction5\p => OneJunction3\p;
ZeroJunction7\p => Joint1\p1;
end;
implementation_end;
]]>
Experiment 1
4.8
Base1\InertialTensor\state_initial
6
1
0 0 0 0 0 0
Base3\InertialTensor\state_initial
6
1
0 0 0 0 0 0
I1\state_initial
0
I\state_initial
0
Joint1\JointType\uTbai\state_initial
6
1
0 0 0 0 0 0
Joint2\JointType\uTbai\state_initial
6
1
0 0 0 0 0 0
PID1\pdstate_initial
0
PID1\pistate_initial
0
PID2\pdstate_initial
0
PID2\pistate_initial
0
PID3\pdstate_initial
0
PID3\pistate_initial
0
PID\pdstate_initial
0
PID\pistate_initial
0
Base2\InertialTensor\p.e_initial
6
1
0 0 0 0 0 0
COM1\I\p.e_initial
2
1
0 0
COM2\I\p.e_initial
2
1
0 0
COM3\I\p.e_initial
2
1
0 0
R1\p.e_initial
0
R\p.e_initial
0
Submodel2\R\p.f_initial
0
Submodel5\R\p.f_initial
0
Joint1\JointType\uTbai\state
6
1
0
0
Joint1\JointType\Integrate\q
time
Submodel3\body_position[1]
Submodel3\body_position[2]
Submodel3\body_position[3]
Submodel3\body_angle[1]
Submodel3\body_angle[2]
Submodel3\body_angle[3]
Submodel3\dimension[1]
Submodel3\dimension[2]
Submodel3\dimension[3]
Submodel4\dimension[1]
Submodel4\dimension[2]
Submodel4\dimension[3]
Submodel4\body_angle[1]
Submodel4\body_angle[2]
Submodel4\body_angle[3]
Submodel4\body_position[1]
Submodel4\body_position[2]
Submodel4\body_position[3]
PlusMinus2\output
PlusMinus3\output
Integrate\output[2]
Integrate\output[1]
new_joint1\position[1]
new_joint1\position[2]
new_joint1\position[3]
new_joint1\R[1,3]
new_joint1\R[2,3]
new_joint1\R[3,3]
new_joint1\R[1,2]
new_joint1\R[2,2]
new_joint1\R[3,2]
new_joint2\R[1,3]
new_joint2\R[2,3]
new_joint2\R[3,3]
new_joint2\R[1,2]
new_joint2\R[2,2]
new_joint2\R[3,2]
new_joint2\position[1]
new_joint2\position[2]
new_joint2\position[3]
PID2\error
PID3\error
new_joint3\position[3]
new_joint3\position[2]
MSe1\effort
MSe2\effort
MSe2\flow
MSe1\flow
GraphPlot
1
false
16777215
true
true
15780518
12624260
0
10
10
10
false
16777215
true
1
model
true
Arial
12
34
400
0
0
0
0
Arial
12
34
400
0
0
0
0
Arial
10
34
400
0
0
0
0
Arial
12
34
400
0
0
0
0
true
true
false
0.0
0.10311339559032781
true
3
-0.009999999999999998
0.04
true
1
-0.25
0.25
true
1
-0.25
0.25
true
1
-0.25
0.25
true
1
3355111
1
6076255
0
true
1
1
1
true
true
time
true
MSe1\effort
6076255
1
6076255
0
true
1
1
1
true
true
time
true
MSe2\effort
12553035
1
12553035
0
false
1
1
1
true
true
time
true
MSe2\flow
15086320
1
15086320
0
false
1
1
1
true
true
time
true
MSe1\flow
true
0.9024193548387097
0.0308411214953271
0
16777215
GraphPlot
2
false
16777215
true
true
15780518
12624260
0
10
10
10
false
16777215
true
1
model(1)
true
Arial
12
34
400
0
0
0
0
Arial
12
34
400
0
0
0
0
Arial
10
34
400
0
0
0
0
Arial
12
34
400
0
0
0
0
true
true
false
0.0
0.10311339559032781
true
3
-1.5
3.5
true
2
0.0
235.918450873204
true
2
3355111
1
3355111
0
true
1
1
1
true
true
time
true
PlusMinus2\output
6076255
1
6076255
0
true
1
1
1
true
true
time
true
PlusMinus3\output
true
0
16777215
D3DPlot
3
false
16777215
true
3D Animation
137
true
false
4294967295
Gradients\BlueWhite.png
true
1.0
1.0
1
1
1
true
Reference Frame
Bryant
false
false
false
false
false
false
1
1
1
false
Default Lights and Cameras
Bryant
false
false
false
false
false
false
false
Ambient
1
1
Direct3D
false
false
false
false
false
false
0
0.3
0.3
0.3
1
1
1
true
0.3
0.3
0.3
1
1
1
true
true
false
false
false
Parallel
-3
5
3
0.457495710997814
-0.762492851663023
-0.457495710997814
0.235379601434674
-0.392299335724456
0.889211827642101
Direct3D
false
false
false
false
false
false
3
0.5
0.5
0.5
1
1
1
true
1.0
0.0
0.0
0.5
0.5
0.5
1
1
1
true
0.5
0.5
0.5
1
1
1
true
false
true
true
false
Spot Light 1
-3
-5
1
0.50709255283711
0.845154254728517
-0.169030850945703
0.0869656553478673
0.144942758913112
0.985610760609162
Direct3D
false
false
false
false
false
false
2
0.5
0.5
0.5
1
1
1
true
1.0
0.05
0.05
1.0471975511965976
1.0471975511965976
0.0
0.5
0.5
0.5
1
1
1
true
0.5
0.5
0.5
1
1
1
true
false
true
true
false
Spot Light 2
2
-3
-1
-0.534522483824849
0.801783725737273
0.267261241912424
0.14824986333222
-0.22237479499833
0.963624111659432
Direct3D
false
false
false
false
false
false
2
1
1
1
1
1
1
true
1.0
0.05
0.05
1.5707963267948966
1.5707963267948966
0.0
1
1
1
1
1
1
true
0.5
0.5
0.5
1
1
1
true
false
true
true
false
Camera Looking at Origin
2.3432919923881
2.28068543057283
1.56751702352047
-0.646203434499502
-0.628938588548314
-0.432270023337153
-0.309771185077498
-0.301494918649693
0.901744213690389
Direct3D
false
false
false
false
false
false
0.01
100.0
true
0.003926990816987242
45.0
-10.0
10.0
10.0
-10.0
true
-9.99200722162641e-016
1.76247905159244e-015
-3.05678199886544e-015
true
1
true
true
true
false
Front(XY)-Camera
10
-1
1
Direct3D
false
false
false
false
false
false
0.01
100.0
true
9.999999999999998
45.0
-9.999999999999998
9.999999999999998
9.999999999999998
-9.999999999999998
true
true
1
true
false
false
false
Side(YZ)-Camera
10
-1
1
Direct3D
false
false
false
false
false
false
0.01
100.0
true
9.999999999999998
45.0
-9.999999999999998
9.999999999999998
9.999999999999998
-9.999999999999998
true
true
1
true
false
false
false
Top(XZ)-Camera
10
-1
1
Direct3D
false
false
false
false
false
false
0.01
100.0
true
9.999999999999998
45.0
-9.999999999999998
9.999999999999998
9.999999999999998
-9.999999999999998
true
true
1
true
false
false
1
1
1
false
Scenery
Bryant
false
false
false
false
false
false
10
10
10
false
Reference Frame
Bryant
false
false
false
false
false
false
Center
1.0
true
4
Submodel3\dimension[1]
0.005
Submodel3\dimension[2]
0.065
Submodel3\dimension[3]
0.01
true
1
1
1
1.0
1
1
1
true
0.498039215686275
0.498039215686275
0.498039215686275
14.298713684082
false
false
Block
Submodel3\body_position[1]
0.0
Submodel3\body_position[2]
-0.009158353632383561
Submodel3\body_position[3]
0.03118053280824738
Submodel3\body_angle[1]
1.8564889888314844
Submodel3\body_angle[2]
0.0
Submodel3\body_angle[3]
0.0
Euler
false
false
false
false
false
false
Center
1.0
true
4
Submodel4\dimension[1]
0.005
Submodel4\dimension[2]
0.05
Submodel4\dimension[3]
0.01
true
1
1
1
1.0
1
1
1
true
0.5
0.5
0.5
15
false
false
Block
Submodel4\body_position[1]
0.0
Submodel4\body_position[2]
0.0013903741642251554
Submodel4\body_position[3]
0.07774345829579168
Submodel4\body_angle[1]
0.66277054304191
Submodel4\body_angle[2]
0.0
Submodel4\body_angle[3]
0.0
Euler
false
false
false
false
false
false
10
10
10
false
Reference Frame
0.5
Bryant
false
false
false
false
false
false
Center
1.0
true
4
Submodel3\dimension[1]
0.005
Submodel3\dimension[2]
0.065
Submodel3\dimension[3]
0.01
true
1
1
1
1.0
1
1
1
true
0.498039215686275
0.498039215686275
0.498039215686275
14.298713684082
false
false
Block
new_joint1\position[1]
0.0
new_joint1\position[2]
-0.009202768540009312
new_joint1\position[3]
0.031169842014341604
new_joint1\R[1,3]
0.0
new_joint1\R[2,3]
-0.9590720619797416
new_joint1\R[3,3]
-0.2831621089233634
new_joint1\R[1,2]
0.0
new_joint1\R[2,2]
-0.2831621089233634
new_joint1\R[3,2]
0.9590720619797416
Matrix
false
false
false
false
false
false
Center
1.0
true
4
Submodel4\dimension[1]
0.005
Submodel4\dimension[2]
0.05
Submodel4\dimension[3]
0.01
true
1
1
1
1.0
1
1
1
true
0.5
0.5
0.5
15
false
false
Block
new_joint2\position[1]
0.0
new_joint2\position[2]
0.0027085042716763867
new_joint2\position[3]
0.07572614202917434
new_joint2\R[1,3]
0.0
new_joint2\R[2,3]
-0.5354583200196454
new_joint2\R[3,3]
0.8445616540678004
new_joint2\R[1,2]
0.0
new_joint2\R[2,2]
0.8445616540678004
new_joint2\R[3,2]
0.5354583200196454
Matrix
false
false
false
false
false
false
GraphPlot
4
false
16777215
true
true
15780518
12624260
0
10
10
10
false
16777215
true
1
model(2)
true
Arial
12
34
400
0
0
0
0
Arial
12
34
400
0
0
0
0
Arial
10
34
400
0
0
0
0
Arial
12
34
400
0
0
0
0
true
true
false
0.021097455593261694
0.115
true
3
-0.06
0.14
true
2
-0.06
0.14
true
2
3355111
1
3355111
0
true
1
1
1
true
true
Integrate\output[1]
true
Integrate\output[2]
6076255
1
6076255
0
true
1
1
1
true
true
new_joint3\position[2]
true
new_joint3\position[3]
true
0
16777215
GraphPlot
5
false
16777215
true
true
15780518
12624260
0
10
10
10
false
16777215
true
1
Plot
true
Arial
12
34
400
0
0
0
0
Arial
12
34
400
0
0
0
0
Arial
10
34
400
0
0
0
0
Arial
12
34
400
0
0
0
0
true
true
false
0.0
0.10311339559032781
true
3
-5.0
5.0
true
2
-1885.20460252739
0.0
true
2
3355111
1
3355111
0
true
1
1
1
true
true
time
true
PID2\error
6076255
1
6076255
0
true
1
1
1
true
true
time
true
PID3\error
true
0
16777215
1
true
Window 1
0
1
2
4
Base
2
false
Window 2
0
3
Base
3
false
Window 3
0
5
Base
0.149479 0.0675926 0.908333 0.847222
0.138021 0.169444 0.777604 0.862963
0.526042 0.287963 0.922396 0.725926
0.0
10.0
false
false
false
false
0.1
1.0e-6
1.0e-7
false
true
Euler
0.01
false
BackwardEuler
1.0e-5
1.0e-5
1.0e-5
1.0e-5
0.01
1.0
AdamsBashforth
0.01
false
RungeKutta2
0.01
false
RungeKutta4
0.01
false
RungeKutta8
false
0.0
false
0.0
1.0e-6
1.0e-6
0.9
0.33
6.0
0.0
false
100000
false
1000
RungeKuttaFehlberg
false
0.0
false
0.0
1.0e-6
1.0e-6
VodeAdams
false
0.0
false
0.0
1.0e-6
1.0e-6
true
true
BDFMethod
1.0e-5
1.0e-5
1.0e-5
1.0e-5
false
0.0
false
0.0
MeBDFiMethod
1.0e-5
1.0e-5
1.0e-5
1.0e-5
false
0.0
false
0.0
8
10
false
true
true
false
true
0
0.0
true
MultipleRun
true
UseEndValue
0.001
BroydonFletcherGoldfarbShanno
true
true
true
true
false
1.0