<?xml version="1.0" encoding="UTF-8"?>
<Document>
  <Model version="4.8" build="4.8.2.10124">
    <Sidops>
<![CDATA[rectanglepath 112 184
 description '<Information>
 <Description>
    <Version>4.8</Version>
  <LibraryPath>setpoint\rectanglepath.emx</LibraryPath>
<IsMainModel>1</IsMainModel>
  <KeepParameterValues>False</KeepParameterValues>
    <TimeStamp>2020-7-10 12:30:38</TimeStamp>
<AllowLibraryUpdate>False</AllowLibraryUpdate>
 </Description>
</Information>';
 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  = 1 {s};
	real origin[2] = [0.05,0.05]{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;
]]>
    </Sidops>
  </Model>
</Document>
