<?xml version="1.0" encoding="UTF-8"?>
<Document>
  <Icons>
    <Icon size="128" bpp="32" format="png">
<![CDATA[89504e470d0a1a0a0000000d4948445200000080000000800806000000c33e61cb00000006624b474400ff00ff00ffa0bda793000000097048597300000ec400000ec401952b0e1b000004cf49444154789cedddbf4b2b5900c5f193652d048bc52230a0c5aa603160a1e00f8804c1a473d28a3692d88b828d49b3102b21ff41060b151b03a633d8042c56218548c04297058b0b41c4c6ca62b672d698c417dd9738eb391f109e33e3dc79e6eb9d9b2031e4791e84d72f5f7d01f2b514003905404e01905300e414003905404e01905300e414003905404e01905300e414003905404e01905300e414003905404e01905300e414003905404e01905300e414003905404e01905300e414003905404e01905300e47e6db631140aad01f8adcbd7225de079de1faf3f0f357b8b985028f41780dfbb7551d23d9ee7855e7fde740678717d7dddd9ab91ae49a7d3383a3a6ad8fe6e000303031dbb20e9aebebebea6dbb50824a700c8290072efae01f42692df47abc75233003905404eb700729a01c82900720a809cd60024f434509a5200e4140039ad01c8690620a700c8e916404e33003905404e0190d31a80845e0a96a6de9d01bed2e6e6266cdbc6caca0acecece70717101630c0020168b211e8f377c4db55ac5c9c9897f1c00589605c771303232f2c3318e8f8ffd7d8944029148c43fefeeee2e00f8c7bff5f61a01606666060b0b0be8e9e9f9d4f7a01b023d033c3c3c2097cbc1711c18636059160060717111954aa5eed842a180d9d959186360db361289042ccb823106939393b8b9b9f9e11800fc311cc7c1cdcd0daad52a666767fded1b1b1b383b3bab3bc7ebaf4f2412fed8abababd8dadafa79df900e08ec0c0000d96c16994c06979797181c1c0400dcdddd219fcfa35c2e636262c23f76747414b95c0ecbcbcbfe4f5c2412f18f2f168bd8d8d8f8d018c56211c6187f5fad56433e9fc7c5c5853f3b542a1564b3591c1e1ed6cd4a914804d16814b1580c8b8b8b75d71a24810e2093c9343c6883838348a5520dc7dab60ddbb61bb6b73abe9d31b2d96c5d18e170b8e15ce57219a9540a7373730de71e1b1b432a956a883548021dc067542a155c5d5de1e1e1c1bf1fe7f3796432990f9f2b93c9f80f7e2bc618e4f3f996fb3f3b76b704f669a0e779fe473bfb6ab51a767676e0ba2e92c9242ccbc2f4f434c2e170cb737d748c66db3dcf433299f4d7006f398e83dededec03ea5fe3633c0dede1e5cd745a9546a986e5fafee3be5654df07f13e867011f618c413299ecfabdd6b22cb8ae8bc7c7c7ae8efbb37c9b005e3c3f3ffbff7e7a7a42a15080ebba1d1b2f1a8d02005cd7ad1b1b001e1f1f91cbe5707b7bdbb1f1ffabc0ae01dab986d7fbe6e7e7b1b4b404e0dfe7f2af5f9479ef5ced8ed16cfbf8f838d2e934b6b7b7fdd72a6cdb46b55a853106aeebc2b66d0c0d0db51ca31b5afd3f02bd06e8efef6f7b5f3c1ec7c1c1014e4f4ffd07de711c4c4d4dbd7bae8f8cd16afbfafa3ae2f1384aa5128c31fef89665e1fcfc1cc3c3c32dc7f86aefbe49d4fdfd7df7af483a626d6d0dfbfbfb0d6f12f5edd600f231815f034867690620a700c8e9164042bf11244d2900720a809cd600e43403905300e4140039ad01c8690620a700c8e91640422f054b530a809c0220a7350039fde55032edfee5d03f01fcddf1ab912fd77406101e5a04925300e414003905404e01905300e414003905404e01905300e414003905404e01905300e414003905404e01905300e414003905404e01905300e414003905404e01905300e414003905404e01905300e41400390540ee1f7809e3354ee82ce20000000049454e44ae426082]]>
     </Icon>
  </Icons>
  <Model version="4.8" build="4.8.2.10124">
    <Sidops>
<![CDATA[stepper 464 224
 description '<Information>
 <Description>
    <Version>4.8</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
  <AllowLibraryUpdate>True</AllowLibraryUpdate>
    <LibraryPath>Motor\stepper2.emx</LibraryPath>
  <TimeStamp>2020-7-22 10:04:39</TimeStamp>
</Description>
</Information>';
 type Submodel
  ports
   signal in angle;
   rotation out p;
 end;
 icon bg bottom
  figures
   rectangle 432 208 496 240 color 0 fill 15132390;
   text 'name' 464 224 color 0 'Clear Sans' 16;
 end;
 implementation bg
  submodels
   I 560 104
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\I.emx</LibraryPath>
  <TimeStamp>2011-11-29 15:55:55</TimeStamp>
</Description>
</Information>';
    type I
     ports
      power in p;
      signal out state;
     restrictions
      causality preferred in p;
    end;
    icon bg bottom
     figures
      text 'I' 560 104 color 0 18 bold;
    end;
    implementation eq
parameters
	real global I_phase;
equations
    state = int(p.e);
    p.f = state / I_phase;
implementation_end;
   I1 608 328
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\I.emx</LibraryPath>
  <TimeStamp>2011-11-29 15:55:55</TimeStamp>
</Description>
</Information>';
    type I
     ports
      power in p;
      signal out state;
     restrictions
      causality preferred in p;
    end;
    icon bg bottom
     figures
      text 'I' 608 328 color 0 18 bold;
    end;
    implementation eq
parameters
	real global I_phase;
equations
    state = int(p.e);
    p.f = state / I_phase;
implementation_end;
   I2 752 160
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\I.emx</LibraryPath>
  <TimeStamp>2011-11-29 15:55:55</TimeStamp>
</Description>
</Information>';
    type I
     ports
      power in p;
      signal out state;
     restrictions
      causality preferred in p;
    end;
    icon bg bottom
     figures
      text 'I' 752 160 color 0 18 bold;
    end;
    implementation eq
parameters
	real i = 8e-5 {kg.m2};
	real global RotorInertia;
equations
    state = int(p.e);
    p.f = state / (i+RotorInertia);
implementation_end;
   MGY_a 656 160
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\MGY.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:03:53</TimeStamp>
</Description>
</Information>';
    type MGY
     ports
      power in p1;
      power out p2;
      signal in r;
     restrictions
      causality constraint equal p1 p2;
    end;
    icon bg bottom
     figures
      text 'MGY' 656 160 color 0 18 bold;
    end;
    implementation eq
equations
	p1.e = r * p2.f;
	p2.e = r * p1.f;
implementation_end;
   MGY_b 656 272
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\MGY.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:03:53</TimeStamp>
</Description>
</Information>';
    type MGY
     ports
      power in p1;
      power out p2;
      signal in r;
     restrictions
      causality constraint equal p1 p2;
    end;
    icon bg bottom
     figures
      text 'MGY' 656 272 color 0 18 bold;
    end;
    implementation eq
equations
	p1.e = r * p2.f;
	p2.e = r * p1.f;
implementation_end;
   MSe_a 512 160
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\MSe.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:12:33</TimeStamp>
</Description>
</Information>';
    type MSe
     ports
      electric out p;
      signal in effort;
     restrictions
      causality fixed out p;
    end;
    icon bg bottom
     figures
      text 'MSe' 512 160 color 0 18 bold;
    end;
    implementation eq
variables
	real flow;
equations
	p.e = effort;
	flow = p.f;
implementation_end;
   MSe_b 512 272
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\MSe.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:12:33</TimeStamp>
</Description>
</Information>';
    type MSe
     ports
      electric out p;
      signal in effort;
     restrictions
      causality fixed out p;
    end;
    icon bg bottom
     figures
      text 'MSe' 512 272 color 0 18 bold;
    end;
    implementation eq
variables
	real flow;
equations
	p.e = effort;
	flow = p.f;
implementation_end;
   plug angle 406.3 216;
   plug p 896.6 216;
   OneJunction 840 216
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\OneJunction.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:17:51</TimeStamp>
</Description>
</Information>';
    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' 840 216 color 0 18 bold;
    end;
    implementation eq
equations
	sum (direct (p.e)) = 0;
	equal (collect (p.f));
	flow = first (p.f);
implementation_end;
   OneJunction1 584 160
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\OneJunction.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:17:51</TimeStamp>
</Description>
</Information>';
    knot OneJunction
     ports
      electric knot duplicatable none p [1];
      signal knot out flow [1];
     restrictions
      causality constraint one_out p;
    end;
    icon bg
     figures
      text '1' 584 160 color 0 18 bold;
    end;
    implementation eq
equations
	sum (direct (p.e)) = 0;
	equal (collect (p.f));
	flow = first (p.f);
implementation_end;
   OneJunction2 584 272
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\OneJunction.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:17:51</TimeStamp>
</Description>
</Information>';
    knot OneJunction
     ports
      electric knot duplicatable none p [1];
      signal knot out flow [1];
     restrictions
      causality constraint one_out p;
    end;
    icon bg
     figures
      text '1' 584 272 color 0 18 bold;
    end;
    implementation eq
equations
	sum (direct (p.e)) = 0;
	equal (collect (p.f));
	flow = first (p.f);
implementation_end;
   OneJunction3 752 216
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\OneJunction.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:17:51</TimeStamp>
</Description>
</Information>';
    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' 752 216 color 0 18 bold;
    end;
    implementation eq
equations
	sum (direct (p.e)) = 0;
	equal (collect (p.f));
	flow = first (p.f);
implementation_end;
   R 608 104
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\R.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:35:37</TimeStamp>
</Description>
</Information>';
    type R
     ports
      power in p;
    end;
    icon bg bottom
     figures
      text 'R' 608 104 color 0 18 bold;
    end;
    implementation eq
parameters
	real global R_phase;
equations
	p.e = R_phase * p.f;
implementation_end;
   R1 560 328
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\R.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:35:37</TimeStamp>
</Description>
</Information>';
    type R
     ports
      power in p;
    end;
    icon bg bottom
     figures
      text 'R' 560 328 color 0 18 bold;
    end;
    implementation eq
parameters
	real global R_phase;
equations
	p.e = R_phase * p.f;
implementation_end;
   R2 824 264
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\R.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:35:37</TimeStamp>
</Description>
</Information>';
    type R
     ports
      power in p;
    end;
    icon bg bottom
     figures
      text 'R' 824 264 color 0 18 bold;
    end;
    implementation eq
parameters
	real r = 1.0e-3;
equations
	p.e = r * p.f;
implementation_end;
   RotorAngle 656 216
    description '<Description><Version>4.0</Version>
   <LibraryPath>Template\Submodel-Equation.emx</LibraryPath>
<IsMainModel>1</IsMainModel>
 <KeepParameterValues>False</KeepParameterValues>
   <TimeStamp>2007-11-1 22:32:1</TimeStamp>
   <AllowLibraryUpdate>False</AllowLibraryUpdate>
</Description>';
    type Submodel
     ports
      signal out output_b;
      signal out output_a;
      signal in omega {rad/s} ;
      signal out output_d;
    end;
    icon bg
     figures
      rectangle 616 200 696 232 color 0 fill 15132390;
      text 'name' 656 216 color 0 'Clear Sans' 16;
    end;
    implementation eq
parameters
	real global fluxLinkage;
	real global detentTorque;
variables
	real global p;
	real angle {rad};
equations
	angle = int(omega);
	output_a = -p * fluxLinkage * sin(p * angle);
	output_b =  p * fluxLinkage * sin(p * angle - pi / 2);
	output_d =  detentTorque * sin(2 * p * angle);
 implementation_end;
   Se 752 272
    description '<Information>
 <Description>
    <Version>4.2</Version>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <LibraryPath>Bond Graph\MSe.emx</LibraryPath>
  <TimeStamp>2011-11-29 16:12:33</TimeStamp>
</Description>
</Information>';
    type MSe
     ports
      power out p;
      signal in effort;
     restrictions
      causality fixed out p;
    end;
    icon bg bottom
     figures
      text 'MSe' 752 272 color 0 18 bold;
    end;
    implementation eq

variables
	real flow;
equations
	p.e = effort;
	flow = p.f;
implementation_end;
   Splitter1 720 216
    description '<Description><Version>4.0</Version>
   <LibraryPath>Signal\Block Diagram\Splitter.emx</LibraryPath>
  <TimeStamp>2008-01-17 11:28:29</TimeStamp>
<IsMainModel>1</IsMainModel>
 <KeepParameterValues>False</KeepParameterValues>
</Description>';
    knot Splitter
     ports
      signal knot duplicatable out output [1];
      signal knot in input [1];
    end;
    icon bg ellipse
     figures
      ellipse 716.8 212.8 723.2 219.2 color -1 fill 0;
      ellipse 715.7 211.7 724.3 220.3 color -1;
     terminals
      input 720 216 fixed;
    end;
    implementation eq
equations
    collect (output) = input;
implementation_end;
   Submodel2 512 216
    description '<Description><Version>4.0</Version>
   <LibraryPath>Template\Submodel-Equation.emx</LibraryPath>
<IsMainModel>1</IsMainModel>
 <KeepParameterValues>False</KeepParameterValues>
   <TimeStamp>2007-11-1 22:32:1</TimeStamp>
   <AllowLibraryUpdate>False</AllowLibraryUpdate>
</Description>';
    type 'Submodel-Equation'
     ports
      signal in angle;
      signal out a;
      signal out b;
    end;
    implementation eq
parameters
	real global u_max {V};
	real global angle_step;
	real max_a {m/s2};
variables
	real current_angle;
	real c,s;
	real global p;
	boolean hidden eventa, eventb;
equations
if time < 10 then
	a = u_max * -sign (cos (p*angle));
	eventa = event(a);
	b = u_max * sign (sin (p*angle));
	eventb = event(b);
	current_angle = angle;
else
	a = u_max * -sign (cos (p*current_angle));
	eventa = event(a);
	b = u_max * sign (sin (p*current_angle));
	eventb = event(b);
end;

	
	
	
 implementation_end;
  end;
  connections
   angle -> Submodel2\angle;
   I2\p <= OneJunction3\p;
   MGY_a\p2 => OneJunction3\p;
   MGY_b\p2 => OneJunction3\p;
   MSe_a\p => OneJunction1\p;
   MSe_b\p => OneJunction2\p;
   OneJunction\p => p;
   OneJunction1\p => I\p;
   OneJunction1\p => MGY_a\p1;
   OneJunction1\p => R\p;
   OneJunction2\p => I1\p;
   OneJunction2\p => MGY_b\p1;
   OneJunction2\p => R1\p;
   OneJunction3\flow -> Splitter1\input;
   OneJunction3\p => OneJunction\p;
   OneJunction3\p => R2\p;
   RotorAngle\output_a -> MGY_a\r;
   RotorAngle\output_b -> MGY_b\r;
   RotorAngle\output_d -> Se\effort;
   Se\p => OneJunction3\p;
   Splitter1\output -> RotorAngle\omega;
   Submodel2\a -> MSe_a\effort;
   Submodel2\b -> MSe_b\effort;
  end;
 implementation_end;
]]>
    </Sidops>
  </Model>
</Document>
