Adjacent instructions with data dependencies do not block each other? - cpu-architecture

From the point of view of instruction pipeline, why do the instructions in the following code not block each other?
.text
.global stress
// void stress(int)
stress:
.loop1:
fmla v2.4s, v0.4s, v1.4s
fmla v3.4s, v0.4s, v1.4s
subs x0, x0, #1
fmla v4.4s, v0.4s, v2.4s
fmla v5.4s, v0.4s, v3.4s
fmla v6.4s, v0.4s, v4.4s
fmla v7.4s, v0.4s, v5.4s
fmla v8.4s, v0.4s, v6.4s
fmla v9.4s, v0.4s, v7.4s
bne .loop1
ret
With minor modifications, they block each other (as expected).
.text
.global stress
// void stress(int)
stress:
.loop1:
fmla v2.4s, v0.4s, v8.4s
fmla v3.4s, v0.4s, v9.4s
subs x0, x0, #1
fmla v4.4s, v0.4s, v2.4s
fmla v5.4s, v0.4s, v3.4s
fmla v6.4s, v0.4s, v4.4s
fmla v7.4s, v0.4s, v5.4s
fmla v8.4s, v0.4s, v6.4s
fmla v9.4s, v0.4s, v7.4s
bne .loop1
ret
t1 is a quarter of t2, and the delay of fmla in the cortex-a76 is 4, which means that the first program has no blocking.

Related

stacked two column charts on top of each other

I am trying to stacked two column charts that have positive and negative values on top of each other. But with the following codes I get the column charts separate and sometimes one is hidden behind the other. I am posting the script and a sample data so that it can be replicable. I am using online Matlab
retndecm(1:52,1)= [0.3715
0.3590
0.2862
0.1936
0.2177
0.2111
0.2019
0.2012
0.2162
0.2236
0.1874
0.2116
0.2569
0.2384
0.2436
0.2416
0.2590
0.2682
0.2695
0.2832
0.2616
0.2506
0.2548
0.2470
0.2612
0.2588
0.2399
0.2848
0.3023
0.3166
0.3535
0.3328
0.3187
0.3365
0.3313
0.3417
0.3411
0.4013
0.3717
0.3574
0.3288
0.3071
0.3271
0.2802
0.2787
0.2649
0.2619
0.2258
0.2432
0.2314
0.2151
0.2080];
retndecm(1:52,2)=[0.0561
0.0462
0.0783
0.1246
0.1099
0.0921
0.0755
0.0675
0.0582
0.0599
0.0249
0.0137
0.0136
0.0108
0.0052
0.0176
0.0259
0.0183
0.0258
0.0312
0.0383
0.0421
0.0293
0.0376
0.0355
0.0344
0.0341
0.0321
0.0404
0.0289
0.0318
0.0374
0.0283
0.0289
0.0405
0.0321
0.0402
0.0528
0.0791
0.0756
0.0798
0.0892
0.0933
0.0978
0.1073
0.1194
0.1172
0.1117
0.1174
0.0960
0.1041
0.1178];
retndecm(1:52,3) = [-0.1152
-0.0963
-0.1035
-0.1144
-0.1309
-0.1289
-0.1337
-0.1347
-0.1272
-0.1289
-0.1361
-0.1176
-0.1057
-0.1125
-0.1068
-0.1119
-0.1142
-0.1188
-0.1163
-0.1115
-0.1098
-0.1145
-0.1110
-0.1046
-0.0953
-0.0985
-0.1044
-0.0967
-0.0964
-0.0932
-0.0959
-0.0938
-0.0930
-0.0843
-0.0815
-0.0673
-0.0609
-0.0591
-0.0464
-0.0736
-0.0681
-0.0691
-0.0612
-0.0758
-0.0658
-0.0690
-0.0736
-0.0774
-0.0731
-0.0762
-0.0711
-0.0754];
ndfspi(1:52,1)= [0.6025
0.6024
0.6028
0.6024
0.6030
0.6028
0.6026
0.6031
0.6031
0.6031
0.6029
0.6029
0.6010
0.6030
0.6033
0.6025
0.6034
0.6021
0.6014
0.6027
0.6031
0.6032
0.6030
0.6032
0.6029
0.6025
0.6024
0.6029
0.6026
0.6011
0.6025
0.6013
0.6025
0.6028
0.5989
0.6025
0.6028
0.6035
0.6035
0.6033
0.6031
0.6030
0.6033
0.6027
0.6030
0.6031
0.6033
0.6029
0.6031
0.6027
0.6026
0.6029];
nfundbeta = ndfspi(1:52,1)-1;
%% figures
set(groot,'DefaultFigureColormap',jet);
r=figure;
hold on;
M=retndecm(:,1)';
t = datetime(2001,1,5) + calweeks(1:52);
h = bar(t, retndecm(:,1),.99,"stacked");
set(h, 'FaceColor', 'flat');
h.CData = ndfspi(:,1)';
caxis([min(-1) max(1)]);
hold on;
t = datetime(2001,1,5) + calweeks(1:52);
l=bar(t,retndecm(:,2),.99,"stacked");
l.FaceColor = [.5 0 .5];
hold on;
N=retndecm(:,3)';
t = datetime(2001,1,5) + calweeks(1:52);
h = bar(t, retndecm(:,3),.99,"stacked");
set(h, 'FaceColor', 'flat');
h.CData = nfundbeta(:,1)';
caxis([min(-1) max(1)]);
colorbar('eastoutside');
set(gcf, 'PaperSize', [20 10], 'PaperPosition', [0 0 20 10])
set(findall(gcf,'-property','FontSize'),'FontSize',12);
saveas(gcf,'test2', 'pdf');
hold off;

How to fix illegal character error in mex files

I'm getting some error message when I try to compile the fortran code on matlab.
>> mex points.f
Warning: MATLAB FORTRAN MEX Files are now defaulting to -largeArrayDims and 8 byte integers.
If you are building a FORTRAN S-Function, please recompile using the -compatibleArrayDims flag.
You can find more about adapting code to use 64-bit array dimensions at:
https://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
Building with 'Intel Parallel Studio XE 2019 for Fortran with Microsoft Visual Studio 2017'.
Error using mex
C:\Users\Kinan\Desktop\Strathshare\Personal Folders\PhD\MATLABPERIDYNAMICS\points.f(44): error #5149: Illegal character in statement
label field [r]
re*8 dx, ral
----^
C:\Users\Kinan\Desktop\Strathshare\Personal Folders\PhD\MATLABPERIDYNAMICS\points.f(45): error #5149: Illegal character in statement
label field [r]
re*8 coordx, coordy, coordz
----^
>C:\Users\Kinan\Desktop\Strathshare\Personal Folders\PhD\MATLABPERIDYNAMICS\points.f(46): error #5149: Illegal character in statement
label field [r]
real*8 coord(totnode,3)
----^
The actual code is
#include "fintrf.h"
C======================================================================
C points.f
C Computational function that creates a cube of equdistant points
C This is a MEX file for MATLAB.
C======================================================================
C Gateway routine
subroutine mexFunction(nlhs, plhs, nrhs, prhs)
C Declarations
implicit none
C mexFunction arguments:
mwPointer plhs(*), prhs(*)
integer nlhs, nrhs
C Function declarations:
mwPointer mxGetDoubles
mwPointer mxCreateDoubleMatrix
integer mxIsNumeric
mwPointer mxGetM, mxGetN
C Pointers to input/output mxArrays:
mwPointer x_ptr, y_ptr
C Array information:
mwPointer mrows, ncols
mwSize size
C Arguments for computational routine:
real*8 dx, r
real*8 coordx, coordy, coordz
real*8 coord(totnode,3)
real*8 ndivx, ndivy, ndivz
integer i, j, k
C Get the size of the input array.
mrows = mxGetM(prhs(1))
ncols = mxGetN(prhs(1))
size = mrows*ncols
MX_HAS_INTERLEAVED_COMPLEX
x_ptr = mxGetDoubles(prhs(1))
C Create matrix for the return argument.
plhs(1) = mxCreateDoubleMatrix(29791,3,0)
y_ptr = mxGetDoubles(plhs(1))
call points(coord,r,dx,ndivx,ndivy,ndivz)
C Load the data into y_ptr, which is the output to MATLAB.
call mxCopyReal8ToPtr(y_output,y_ptr,size)
return
end
C-----------------------------------------------------------------------
C Computational routine
subroutine points(coord,r,dx,ndivx,ndivy,ndivz)
C Arguments for computational routine:
real*8 dx, r, coordx, coordy, coordz
real*8 coord(totnode,3), ndivx, ndivy, ndivz
integer i, j, k
do i = 1,ndivx
do j = 1,ndivy
do k = 1,ndivz
coordx = -1.0d0 / 2.0d0 * r + (dx / 2.0d0) + (i - 1) * dx
coordy = -1.0d0 / 2.0d0 * r + (dx / 2.0d0) + (j - 1) * dx
coordz = -1.0d0 / 2.0d0 * r + (dx / 2.0d0) + (k - 1) * dx
nnum = nnum + 1
coord(nnum,1) = coordx
coord(nnum,2) = coordy
coord(nnum,3) = coordz
enddo
enddo
enddo
return
end
I have a few for loops I need to do this for so if I can get a working template it would help a lot.
Sorry I tried to add more of the error message but it said I had too much code
I managed to MEX the code, but there are too many errors...
For suppressing the warning about largeArrayDims you can execute:
warning('Off', 'MATLAB:mex:FortranLargeArrayDimsWarn_link');
Note: Your Fortran code applies MX_HAS_INTERLEAVED_COMPLEX, so you need to add -2018a flag to the mex command.
I could not find a way to avoid the warning when using -2018a flag.
MEX command line uses -2018a flag:
mex -R2018a points.F
I had to make too many modifications to your code, in order to pass compilation:
I added spaces to the beginning of the lines.
I removed MX_HAS_INTERLEAVED_COMPLEX.
I didn't know what to do with totnode, so I replaced it with the value 100.
I didn't know what to do with y_output, so I replaced it with coord.
Here is your modified code that passes compilation:
#include "fintrf.h"
C======================================================================
C points.f
C Computational function that creates a cube of equdistant points
C This is a MEX file for MATLAB.
C======================================================================
C Gateway routine
subroutine mexFunction(nlhs, plhs, nrhs, prhs)
C Declarations
implicit none
C mexFunction arguments:
mwPointer plhs(*), prhs(*)
integer nlhs, nrhs
C Function declarations:
mwPointer mxGetDoubles
mwPointer mxCreateDoubleMatrix
integer mxIsNumeric
mwPointer mxGetM, mxGetN
C Pointers to input/output mxArrays:
mwPointer x_ptr, y_ptr
C Array information:
mwPointer mrows, ncols
mwSize size
C Arguments for computational routine:
real*8 dx, r
real*8 coordx, coordy, coordz
C What is totnode???
C real*8 coord(totnode,3)
real*8 coord(100,3)
real*8 ndivx, ndivy, ndivz
integer i, j, k
C Get the size of the input array.
mrows = mxGetM(prhs(1))
ncols = mxGetN(prhs(1))
size = mrows*ncols
C MX_HAS_INTERLEAVED_COMPLEX
x_ptr = mxGetDoubles(prhs(1))
C Create matrix for the return argument.
plhs(1) = mxCreateDoubleMatrix(29791,3,0)
y_ptr = mxGetDoubles(plhs(1))
call points(coord,r,dx,ndivx,ndivy,ndivz)
C Load the data into y_ptr, which is the output to MATLAB.
C call mxCopyReal8ToPtr(y_output,y_ptr,size) What is y_output???
call mxCopyReal8ToPtr(coord,y_ptr,size)
return
end
C-----------------------------------------------------------------------
C Computational routine
subroutine points(coord,r,dx,ndivx,ndivy,ndivz)
C Arguments for computational routine:
real*8 dx, r, coordx, coordy, coordz
C What is totnode???
C real*8 coord(totnode,3), ndivx, ndivy, ndivz
real*8 coord(100,3), ndivx, ndivy, ndivz
integer i, j, k
do i = 1,ndivx
do j = 1,ndivy
do k = 1,ndivz
coordx = -1.0d0 / 2.0d0 * r + (dx / 2.0d0) + (i - 1) * dx
coordy = -1.0d0 / 2.0d0 * r + (dx / 2.0d0) + (j - 1) * dx
coordz = -1.0d0 / 2.0d0 * r + (dx / 2.0d0) + (k - 1) * dx
nnum = nnum + 1
coord(nnum,1) = coordx
coord(nnum,2) = coordy
coord(nnum,3) = coordz
enddo
enddo
enddo
return
end
I hope it helps you continue your development.

Extending packages and access to the content

I continue work on understanding how to best divide code in library and application. In a few previous posts I have worked with a toy example DEMO_xx library with application dxx_app7. Below is a slightly updated version to cover the question here. I have included the possibility to add a sensor to the harvest tank.
Now I want to understand how to in application code bring in information from the application Medium7 that is extended from the library Medium2 and use that fully in a new component model in the application.
What I understand is that if you import a package that is extended from another package you only get what is the “latest” package and NOT what is built up from through extensions and what is aggregated total Medium7 information.
This fact is illustrated in the example by changing the constant SensorX.component from C that works to A or B that does not work.
However, if I make a local instance of Medium7 THEN I get the complete information of Medium7. I can do that in SensorX as marked Question 1 - alt 2.
I can also do this choice of substrate to measure out in the configuration of the system and marked Question 1 alt 3. This is more readable code I think.
But how do I make all of the content of Medium7 available locally? Must I define locally a new constant for every constant I need as I show here with sensorX.component? Generally you may want to in a model have access to various properties of the medium and that is convenient to put in the package Medium
Also I wish I could import a connector LiquidCon adapted for Medium7 instead of writing that code once again in package Sensor7. Import as suggested does not work. Is there another way? I have only tested the code in JModelica 2.4 and it might be a bug?
Would appreciate some input on these two questions. / Jan Peter
Below the application code d12_app7 that is of interest for the questions and then the associated library DEMO_v12. I have marked up with comments changes of code for the two questions and as the code stands it is for question 1 alt 1.
encapsulated package d12_app7
// ---------------------------------------------------------------------------------------------
// Interfaces
// ---------------------------------------------------------------------------------------------
import Modelica.Blocks.Interfaces.RealInput;
import Modelica.Blocks.Interfaces.RealOutput;
package Medium7
import M2 = DEMO_v12.Medium2;
extends M2
(name = "Seven components" "Medium name",
nc = 7 "Number of substances",
mw = cat(1,M2.mw,{30,40,50,60,70}) "Substance weight",
redeclare type Concentration = Real[nc] "Substance conc");
constant Integer C = 3 "Substance index";
constant Integer D = 4 "Substance index";
constant Integer E = 5 "Substance index";
constant Integer F = 6 "Substance index";
constant Integer G = 7 "Substance index";
end Medium7;
// ---------------------------------------------------------------------------------------------
// New sensor introduced in this application for measurement of substance A
// ---------------------------------------------------------------------------------------------
package Sensor7
connector LiquidCon
Medium7.Concentration c "Substance conc";
flow Real F (unit="m3/s") "Flow rate";
end LiquidCon;
model SensorX
// import d12_app7.Equipment7.LiquidCon; // Question 2
import d12_app7.Medium7.*; // Question 1 - alt 1
constant Integer component = C; // Question 1 - alt 1
// constant Integer component = d12_app7.Medium7.A; // Question 1 - alt 2
LiquidCon probe;
RealOutput out;
equation
probe.F = 0;
out = probe.c[component];
end SensorX;
end Sensor7;
// ---------------------------------------------------------------------------------------------
// Adaptation of library DEMO_v12 to Medium7
// ---------------------------------------------------------------------------------------------
package Equipment7
import DEMO_v12.Equipment;
extends Equipment(redeclare package Medium=Medium7);
end Equipment7;
// ---------------------------------------------------------------------------------------------
// Examples of systems
// ---------------------------------------------------------------------------------------------
import DEMO_v12.Control;
model Test
Equipment7.Medium medium; // Instance not necessary but helpful for user interface
Equipment7.PumpType pump;
Equipment7.FeedtankType feedtank;
Equipment7.HarvesttankType harvesttank;
Sensor7.SensorX sensor; // Question 1 alt 1 and 2
// Sensor7.SensorX sensor(component = medium.A); // Question 1 alt 3
Control.FixValueType Fsp(val=0.2);
equation
connect(feedtank.outlet, pump.inlet);
connect(pump.outlet, harvesttank.inlet);
connect(Fsp.out, pump.Fsp);
connect(sensor.probe, harvesttank.port);
end Test;
end d12_app7;
And finally the library code DEMO_v12
package DEMO_v12
// ---------------------------------------------------------------------------------------------
// Interfaces
// ---------------------------------------------------------------------------------------------
import Modelica.Blocks.Interfaces.RealInput;
import Modelica.Blocks.Interfaces.RealOutput;
package Medium2
replaceable constant String name = "Two components" "Medium name";
replaceable constant Integer nc = 2 "Number of substances";
replaceable type Concentration = Real[nc] "Substance conc";
replaceable constant Real[nc] mw = {10, 20} "Substance weight";
constant Integer A = 1 "Substance index";
constant Integer B = 2 "Substance index";
end Medium2;
package Medium3
import M2 = DEMO_v12.Medium2;
extends M2
(name="Three components" "Medium name",
nc=3 "Number of substances",
mw = cat(1,M2.mw,{30}) "Substance weight",
redeclare type Concentration = Real[nc] "Substance conc");
constant Integer C = 3 "Substance index";
end Medium3;
// ---------------------------------------------------------------------------------------------
// Equipment dependent on the medium
// ---------------------------------------------------------------------------------------------
package Equipment
replaceable package Medium
end Medium;
connector LiquidCon
Medium.Concentration c "Substance conc";
flow Real F (unit="m3/s") "Flow rate";
end LiquidCon;
model PumpType
LiquidCon inlet, outlet;
RealInput Fsp;
equation
inlet.F = Fsp;
connect(outlet, inlet);
end PumpType;
model FeedtankType
LiquidCon outlet;
constant Integer medium_nc = size(outlet.c,1);
parameter Real[medium_nc] c_in (each unit="kg/m3")
= {1.0*k for k in 1:medium_nc} "Feed inlet conc";
parameter Real V_0 (unit="m3") = 100 "Initial feed volume";
Real V(start=V_0, fixed=true, unit="m3") "Feed volume";
equation
for i in 1:medium_nc loop
outlet.c[i] = c_in[i];
end for;
der(V) = outlet.F;
end FeedtankType;
model HarvesttankType
LiquidCon inlet, port;
constant Integer medium_nc = size(inlet.c,1);
parameter Real V_0 (unit="m3") = 1.0 "Initial harvest liquid volume";
parameter Real[medium_nc] m_0
(each unit="kg/m3") = zeros(medium_nc) "Initial substance mass";
Real[medium_nc] c "Substance conc";
Real[medium_nc] m
(start=m_0, each fixed=true) "Substance mass";
Real V(start=V_0, fixed=true, unit="m3") "Harvest liquid volume";
equation
for i in 1:medium_nc loop
der(m[i]) = inlet.c[i]*inlet.F;
c[i] = m[i]/V;
port.c[i] = c[i];
end for;
der(V) = inlet.F;
end HarvesttankType;
end Equipment;
// ---------------------------------------------------------------------------------------------
// Control
// ---------------------------------------------------------------------------------------------
package Control
block FixValueType
RealOutput out;
parameter Real val=0;
equation
out = val;
end FixValueType;
end Control;
// ---------------------------------------------------------------------------------------------
// Examples of systems
// ---------------------------------------------------------------------------------------------
// package Equipment3 = Equipment(redeclare package Medium=Medium3); // Just shorter version
package Equipment3
import DEMO_v12.Equipment;
extends Equipment(redeclare package Medium=Medium3);
end Equipment3;
model Test
Equipment3.Medium medium;
Equipment3.FeedtankType feedtank;
Equipment3.HarvesttankType harvesttank;
Equipment3.PumpType pump;
Control.FixValueType Fsp(val=0.2);
equation
connect(feedtank.outlet, pump.inlet);
connect(pump.outlet, harvesttank.inlet);
connect(Fsp.out, pump.Fsp);
end Test;
end DEMO_v12;
I have also on this post recently got some help from people related to Modelon-JModelica and to OpenModelica - thank you! Below answers and comments as well as updated code.
To make content of Medium7 available we can (likely) do as in the presented code. In my new code I decide what substance to measure not until configuration of the Test model. Therefore I in the model SensorX make a declaration constant Integer component without any value. Note a constant can only be given a value once.
To avoid writing the code of LiquidCon a second time it is better to put the code of the sensor model in the extension of package Equipment where adaptation is made to Medium7.
In the model Test we need to have access to the mnemonics of components. The construction in the code with an instance of a package is not allowed in Modelica (but still works in JModelica and OpenModelica). A generally accepted way to do is given in the new code. Note that this solution makes the content of the actual Medium not accessible through FMU. To get that accessibility local instances need to be made of various medium constants in the model, as done with name.
I have in DEMO_v20.Medium2 taken away “replaceable” in front of constants, and the technique to just give these Medium constants different values in Medium3 is allowed since Modelica 3.2 (but not in 3.1) according to Hans Olsson in a previous post response.
I have in DEMO_v20 introduced a partial MediumBase and then Medium2 extends from that and MeiumBase also is constraining type for the formal parameter Medium for package Equipment.
The code works for JModelica both running DEMO_v20 alone with the Test example for three substances and together with the application code for seven substances. In OpenModelica only the Test example for three substances work, however.
Would appreciate help to get the code working in OpenModelica and to check it in Dymolas as well.
Library code DEMO_v20
package DEMO_v20
// Here I have put together a small demo-library to illustrate questions
// around structuring handling of medium. The key structures are taken
// from MSL fluid, I think it is fair to say.
// ---------------------------------------------------------------------------------------------
// Interfaces
// ---------------------------------------------------------------------------------------------
import Modelica.Blocks.Interfaces.RealInput;
import Modelica.Blocks.Interfaces.RealOutput;
partial package MediumBase
constant String name "Medium name";
constant Integer nc "Number of substances";
replaceable type Concentration = Real[nc] "Substance conc";
end MediumBase;
package Medium2
extends MediumBase
(name="Two components",
nc=2);
constant Real[nc] mw = {10, 20} "Substance weight";
constant Integer A = 1 "Substance index";
constant Integer B = 2 "Substance index";
end Medium2;
package Medium3
import M2 = DEMO_v20.Medium2;
extends M2
(name="Three components" "Medium name",
nc=3 "Number of substances",
mw = cat(1,M2.mw,{30}) "Substance weight");
constant Integer C = 3 "Substance index";
end Medium3;
// ---------------------------------------------------------------------------------------------
// Equipment dependent on the medium
// ---------------------------------------------------------------------------------------------
package Equipment
replaceable package Medium = MediumBase
constrainedby MediumBase;
connector LiquidCon
Medium.Concentration c "Substance conc";
flow Real F (unit="m3/s") "Flow rate";
end LiquidCon;
model PumpType
LiquidCon inlet, outlet;
RealInput Fsp;
equation
inlet.F = Fsp;
connect(outlet, inlet);
end PumpType;
model FeedtankType
LiquidCon outlet;
constant Integer medium_nc = size(outlet.c,1);
parameter Real[medium_nc] c_in (each unit="kg/m3")
= {1.0*k for k in 1:medium_nc} "Feed inlet conc";
parameter Real V_0 (unit="m3") = 100 "Initial feed volume";
Real V(start=V_0, fixed=true, unit="m3") "Feed volume";
equation
for i in 1:medium_nc loop
outlet.c[i] = c_in[i];
end for;
der(V) = outlet.F;
end FeedtankType;
model HarvesttankType
LiquidCon inlet, port;
constant Integer medium_nc = size(inlet.c,1);
parameter Real V_0 (unit="m3") = 1.0 "Initial harvest liquid volume";
parameter Real[medium_nc] m_0
(each unit="kg/m3") = zeros(medium_nc) "Initial substance mass";
Real[medium_nc] c "Substance conc";
Real[medium_nc] m
(start=m_0, each fixed=true) "Substance mass";
Real V(start=V_0, fixed=true, unit="m3") "Harvest liquid volume";
equation
for i in 1:medium_nc loop
der(m[i]) = inlet.c[i]*inlet.F;
c[i] = m[i]/V;
port.c[i] = c[i];
end for;
der(V) = inlet.F;
end HarvesttankType;
end Equipment;
// ---------------------------------------------------------------------------------------------
// Control
// ---------------------------------------------------------------------------------------------
package Control
block FixValueType
RealOutput out;
parameter Real val=0;
equation
out = val;
end FixValueType;
end Control;
// ---------------------------------------------------------------------------------------------
// Adaptation of package Equipment to Medium3
// ---------------------------------------------------------------------------------------------
package Equipment3
extends DEMO_v20.Equipment(redeclare package Medium=Medium3);
end Equipment3;
// ---------------------------------------------------------------------------------------------
// Examples of systems
// ---------------------------------------------------------------------------------------------
model Test
package medium = DEMO_v20.Medium3; // Not accessible in FMU though
constant String name = medium.name; // But name here is accessible
Equipment3.FeedtankType feedtank;
Equipment3.HarvesttankType harvesttank;
Equipment3.PumpType pump;
Control.FixValueType Fsp(val=0.2);
equation
connect(feedtank.outlet, pump.inlet);
connect(pump.outlet, harvesttank.inlet);
connect(Fsp.out, pump.Fsp);
end Test;
end DEMO_v20;
And the corresponding application code d20_app7.mo
encapsulated package d20_app7
// ---------------------------------------------------------------------------------------------
// Interfaces
// ---------------------------------------------------------------------------------------------
import Modelica.Blocks.Interfaces.RealInput;
import Modelica.Blocks.Interfaces.RealOutput;
package Medium7
import M2 = DEMO_v20.Medium2;
extends M2
(name = "Seven components" "Medium name",
nc = 7 "Number of substances",
mw = cat(1,M2.mw,{30,40,50,60,70}) "Substance weight");
constant Integer C = 3 "Substance index";
constant Integer D = 4 "Substance index";
constant Integer E = 5 "Substance index";
constant Integer F = 6 "Substance index";
constant Integer G = 7 "Substance index";
end Medium7;
// ---------------------------------------------------------------------------------------------
// Adaptation of library DEMO_v20 to Medium7 and including a new model SensorX
// ---------------------------------------------------------------------------------------------
package Equipment7
extends DEMO_v20.Equipment(redeclare package Medium=Medium7);
model SensorX
LiquidCon probe;
RealOutput out;
constant Integer component "Component measured";
equation
probe.F = 0;
out = probe.c[component];
end SensorX;
end Equipment7;
// ---------------------------------------------------------------------------------------------
// Examples of systems
// ---------------------------------------------------------------------------------------------
import DEMO_v20.Control;
model Test
package medium = Medium7; // Not accessible in FMU though
constant String name = medium.name; // But name here is accessible
Equipment7.PumpType pump;
Equipment7.FeedtankType feedtank;
Equipment7.HarvesttankType harvesttank;
Equipment7.SensorX sensor(component = medium.G);
Control.FixValueType Fsp(val=0.2);
equation
connect(feedtank.outlet, pump.inlet);
connect(pump.outlet, harvesttank.inlet);
connect(Fsp.out, pump.Fsp);
connect(sensor.probe, harvesttank.port);
end Test;
end d20_app7;
Tested both DEMO_v20.mo and d20_app7.mo in Dymola Version 2018 (64-bit), 2017-04-10.
Loading the file DEMO_v20.mo gives the error,
<medium declaration> (line 137, column 27: C:/Users/adeas31/Desktop/DEMO_v20.mo)
medium already declared on line 135.
And running DEMO_v20.Test gives,
Translation of DEMO_v20.Test:
For variable feedtank.medium_nc
declared in class DEMO_v20.Equipment.FeedtankType, C:/Users/adeas31/Desktop/DEMO_v20.mo at line 77, and used in component feedtank.
The variability of the definition equation:
feedtank.medium_nc = size(feedtank.outlet.c, 1);
is higher than the declared variability of the variables.
For variable harvesttank.medium_nc
declared in class DEMO_v20.Equipment.HarvesttankType, C:/Users/adeas31/Desktop/DEMO_v20.mo at line 91, and used in component harvesttank.
The variability of the definition equation:
harvesttank.medium_nc = size(harvesttank.inlet.c, 1);
is higher than the declared variability of the variables.
Basic type inconsistencies detected.
Translation aborted.
ERRORS have been issued.
Running d20_app7.Test gives,
Translation of d20_app7.Test:
Encapsulation of d20_app7
prevented us from finding DEMO_v20 in global scope.
Missing base class DEMO_v20.Equipment
the class DEMO_v20.Equipment exists, but Modelica is case-sensitive and uses scoping
File: C:/Users/adeas31/Desktop/d20_app7.mo, line 46
Context: d20_app7.Equipment7
Component type specifier Equipment7.PumpType not found
File: C:/Users/adeas31/Desktop/d20_app7.mo, line 67
Component context: pump
Component declared as Equipment7.PumpType pump in d20_app7.Test
Component type specifier Equipment7.FeedtankType not found
File: C:/Users/adeas31/Desktop/d20_app7.mo, line 68
Component context: feedtank
Component declared as Equipment7.FeedtankType feedtank in d20_app7.Test
Component type specifier Equipment7.HarvesttankType not found
File: C:/Users/adeas31/Desktop/d20_app7.mo, line 69
Component context: harvesttank
Component declared as Equipment7.HarvesttankType harvesttank in d20_app7.Test
Component type specifier LiquidCon not found
File: C:/Users/adeas31/Desktop/d20_app7.mo, line 49
Component context: sensor.probe
Component declared as LiquidCon probe in d20_app7.Equipment7.SensorX
WARNINGS have been issued.
ERRORS have been issued.
Hope that helps.
Thank you Adeel!
The Dymola error log made me do the following changes to the code:
DEMO_v20 here I eliminated the instantiation of medium - forgot it see 3) above
DEMO_v20 here I now get the size of the models from Medium.nc instead of through the connector and size of c.
D20_app7 here I now in the procedure of adaptation of package Equipment, first import, and then extend and adapt to Medium7.
The updated code DEMO_v22 and d22_app7 now works with both JModelica and OpenModelica. Would be good to have it tested in Dymola too 🙂
Updated code DEMO_v22.mo
package DEMO_v22
// Here I have put together a small demo-library to illustrate questions
// around structuring handling of medium. The key structures are taken
// from MSL fluid, I think it is fair to say.
// ---------------------------------------------------------------------------------------------
// Interfaces
// ---------------------------------------------------------------------------------------------
import Modelica.Blocks.Interfaces.RealInput;
import Modelica.Blocks.Interfaces.RealOutput;
partial package MediumBase
constant String name "Medium name";
constant Integer nc "Number of substances";
replaceable type Concentration = Real[nc] "Substance conc";
end MediumBase;
package Medium2
extends MediumBase
(name="Two components",
nc=2);
constant Real[nc] mw = {10, 20} "Substance weight";
constant Integer A = 1 "Substance index";
constant Integer B = 2 "Substance index";
end Medium2;
package Medium3
import M2 = DEMO_v22.Medium2;
extends M2
(name="Three components" "Medium name",
nc=3 "Number of substances",
mw = cat(1,M2.mw,{30}) "Substance weight");
constant Integer C = 3 "Substance index";
end Medium3;
// ---------------------------------------------------------------------------------------------
// Equipment dependent on the medium
// ---------------------------------------------------------------------------------------------
package Equipment
replaceable package Medium = MediumBase
constrainedby MediumBase;
connector LiquidCon
Medium.Concentration c "Substance conc";
flow Real F (unit="m3/s") "Flow rate";
end LiquidCon;
model PumpType
LiquidCon inlet, outlet;
RealInput Fsp;
equation
inlet.F = Fsp;
connect(outlet, inlet);
end PumpType;
model FeedtankType
LiquidCon outlet;
parameter Real[Medium.nc] c_in (each unit="kg/m3")
= {1.0*k for k in 1:Medium.nc} "Feed inlet conc";
parameter Real V_0 (unit="m3") = 100 "Initial feed volume";
Real V(start=V_0, fixed=true, unit="m3") "Feed volume";
equation
for i in 1:Medium.nc loop
outlet.c[i] = c_in[i];
end for;
der(V) = outlet.F;
end FeedtankType;
model HarvesttankType
LiquidCon inlet, port;
parameter Real V_0 (unit="m3") = 1.0 "Initial harvest liquid volume";
parameter Real[Medium.nc] m_0
(each unit="kg/m3") = zeros(Medium.nc) "Initial substance mass";
Real[Medium.nc] c "Substance conc";
Real[Medium.nc] m
(start=m_0, each fixed=true) "Substance mass";
Real V(start=V_0, fixed=true, unit="m3") "Harvest liquid volume";
equation
for i in 1:Medium.nc loop
der(m[i]) = inlet.c[i]*inlet.F;
c[i] = m[i]/V;
port.c[i] = c[i];
end for;
der(V) = inlet.F;
end HarvesttankType;
end Equipment;
// ---------------------------------------------------------------------------------------------
// Control
// ---------------------------------------------------------------------------------------------
package Control
block FixValueType
RealOutput out;
parameter Real val=0;
equation
out = val;
end FixValueType;
end Control;
// ---------------------------------------------------------------------------------------------
// Adaptation of package Equipment to Medium3
// ---------------------------------------------------------------------------------------------
package Equipment3
extends DEMO_v22.Equipment(redeclare package Medium=Medium3);
end Equipment3;
// ---------------------------------------------------------------------------------------------
// Examples of systems
// ---------------------------------------------------------------------------------------------
model Test
package medium = DEMO_v22.Medium3; // Not accessible in FMU though
constant String name = medium.name; // But name here is now accessible
Equipment3.FeedtankType feedtank;
Equipment3.HarvesttankType harvesttank;
Equipment3.PumpType pump;
Control.FixValueType Fsp(val=0.2);
equation
connect(feedtank.outlet, pump.inlet);
connect(pump.outlet, harvesttank.inlet);
connect(Fsp.out, pump.Fsp);
end Test;
end DEMO_v22;
and updated application code d22_app7.mo
encapsulated package d22_app7
// Here I put together an application for 7 substances - print 8 pt
// and import code from the library DEMO.
// ---------------------------------------------------------------------------------------------
// Interfaces
// ---------------------------------------------------------------------------------------------
import Modelica.Blocks.Interfaces.RealInput;
import Modelica.Blocks.Interfaces.RealOutput;
package Medium7
import M2 = DEMO_v22.Medium2;
extends M2
(name = "Seven components" "Medium name",
nc = 7 "Number of substances",
mw = cat(1,M2.mw,{30,40,50,60,70}) "Substance weight");
constant Integer C = 3 "Substance index";
constant Integer D = 4 "Substance index";
constant Integer E = 5 "Substance index";
constant Integer F = 6 "Substance index";
constant Integer G = 7 "Substance index";
end Medium7;
// ---------------------------------------------------------------------------------------------
// Adaptation of library DEMO_v22 to Medium7 and including a new model SensorX
// ---------------------------------------------------------------------------------------------
package Equipment7
import DEMO_v22.Equipment;
extends Equipment(redeclare package Medium=Medium7);
model SensorX
LiquidCon probe;
RealOutput out;
constant Integer component "Component measured";
equation
probe.F = 0;
out = probe.c[component];
end SensorX;
end Equipment7;
// ---------------------------------------------------------------------------------------------
// Examples of systems
// ---------------------------------------------------------------------------------------------
import DEMO_v22.Control;
model Test
package medium = Medium7; // Not accessible in FMU though
constant String name = medium.name; // But name here is accessible
Equipment7.PumpType pump;
Equipment7.FeedtankType feedtank;
Equipment7.HarvesttankType harvesttank;
Equipment7.SensorX sensor(component = medium.G);
Control.FixValueType Fsp(val=0.2);
equation
connect(feedtank.outlet, pump.inlet);
connect(pump.outlet, harvesttank.inlet);
connect(Fsp.out, pump.Fsp);
connect(sensor.probe, harvesttank.port);
end Test;
end d22_app7;

Trying to return array from Fortran to Matlab with mex, getting empty array instead

So, I'm trying to return a an array of numbers from 1-n.
#include "fintrf.h"
C Gateway routine
subroutine mexFunction(nlhs, plhs, nrhs, prhs)
C Declarations
implicit none
C mexFunction arguments:
mwPointer plhs(*), prhs(*)
integer nlhs, nrhs
mwPointer mxGetPr
mwPointer mxCreateDoubleMatrix
mwPointer mxGetM, mxGetN
mwPointer mrows, ncols
mwSize size
mwPointer x_ptr, y_ptr
integer x_input,i
real*8, allocatable :: vec(:)
x_ptr = mxGetPr(prhs(1))
mrows = mxGetM(prhs(1))
ncols = mxGetN(prhs(1))
size = mrows*ncols
x_ptr=mxGetPr(prhs(1))
call mxCopyPtrToReal8(x_ptr,x_input,size)
allocate (vec(x_input))
do i=1,x_input
vec(i)=i
end do
plhs(1) = mxCreateDoubleMatrix(1, x_input, 0)
y_ptr = mxGetPr(plhs(1))
call mxCopyReal8ToPtr(vec,y_ptr,x_input)
deallocate ( vec )
return
end
I then call the mex file in fortran here
mex testingvec.F
Building with 'gfortran'.
MEX completed successfully.
a=testingvec(10);
and then find
a=[]
Can someone give me some help on this? If someone can give me some example code how to return a matrix as well, that would be sweet.
Thanks guys.
edit: new installment of the code. Still trying to get some help.
#include "fintrf.h"
C Gateway routine
subroutine mexFunction(nlhs, plhs, nrhs, prhs)
C Declarations
implicit none
C mexFunction arguments:
mwPointer plhs(*), prhs(*)
integer nlhs, nrhs
mwPointer mxGetPr
mwPointer mxCreateDoubleMatrix
mwPointer mxGetM, mxGetN
mwPointer mrows, ncols
mwSize size
mwPointer x_ptr, y_ptr
integer i
mwSize sizeone, x_input
integer*4 izero
real*8, allocatable :: vec(:)
x_ptr = mxGetPr(prhs(1))
mrows = mxGetM(prhs(1))
ncols = mxGetN(prhs(1))
size = mrows*ncols
sizeone=1
izero=0
x_ptr=mxGetPr(prhs(1))
call mxCopyPtrToReal8(x_ptr,x_input,size)
allocate (vec(x_input))
do i=1,x_input
vec(i)=i
end do
plhs(1) = mxCreateDoubleMatrix(sizeone,x_input,izero)
call mxCopyReal8ToPtr(vec,mxGetPr(plhs(1)),x_input)
deallocate ( vec )
return
end
There were both declaration problems and issues with calls to mex functions. Here's a solution, which assumes that the input is an integer-valued double giving you the length of the output vector (assuming that this is what you wanted).
#include "fintrf.h"
C Gateway routine
subroutine mexFunction(nlhs, plhs, nrhs, prhs)
C Declarations
implicit none
C mexFunction arguments:
mwPointer plhs(*), prhs(*)
integer*4 nlhs, nrhs
mwPointer mxGetPr
mwPointer mxCreateDoubleMatrix
mwSize mxGetM, mxGetN
mwSignedIndex mrows, ncols
mwSize size, x_input, sizeone
mwPointer x_ptr, y_ptr
integer*4 i, izero, x_int
real*8, allocatable :: vec(:)
real*8 :: x_dbl
sizeone = 1
izero = 0
!check input/output syntax
if (nrhs /= 1) then
call mexErrMsgIdAndTxt("MATLAB:testingvec:rhs",
> "Exactly 1 input variable required.")
end if
if (nlhs /= 1) then
call mexErrMsgIdAndTxt("MATLAB:testingvec:lhs",
> "Exactly 1 output matrix required.")
end if
x_ptr = mxGetPr(prhs(1))
mrows = mxGetM(prhs(1))
ncols = mxGetN(prhs(1))
size = mrows*ncols
call mxCopyPtrToReal8(x_ptr,x_dbl,sizeone)
x_input = int(x_dbl)
allocate (vec(x_input))
do i=1,x_input
vec(i)=i
end do
plhs(1) = mxCreateDoubleMatrix(sizeone, x_input, izero)
y_ptr = mxGetPr(plhs(1))
call mxCopyReal8ToPtr(vec,y_ptr,x_input)
deallocate ( vec )
return
end
I introduced a check for the number of input/output variables (to be updated in the actual program). And I introduced an auxiliary x_dbl which might or might not be necessary. This version reads the double input given to your function, and truncates it to get x_input.

Extended Kalman Filter prediction Matlab

I'v implemented EKF (Extended Kalman Filter) in Matlab for Visual Tracking of Object's 3D trajectory, However, I'm giving it actual trajectory's position and velocity as in1 and in2 respectively. I'm facing wrong prediction after some points which is usually opposite to the actual trajectory. What I think, it may be some initial assumptions problem as I'v checked the equations many times but unable to find the bug. How to fix my initial assumptions or to avoid by any other guesses? Sample position and velocity are given.
Any suggestions for improving my approach are welcomed.
My Code:
function EKF(in1,in2)
ind=0; % indicator function. Used for unwrapping of tan
[H] = [];
[K] = [];
[Z] = [];
Q=[0 0 0 0 0 0;
0 0 0 0 0 0;
0 0 0 0 0 0;
0 0 0 0.01 0 0;
0 0 0 0 0.01 0;
0 0 0 0 0 0.01];% Covarience matrix of process noise
M=[0.001 0 0; 0 0.001 0; 0 0 0.001]; % Covarience matrix of measurment noise
A=[1 0 0 0.1 0 0;
0 1 0 0 0.1 0;
0 0 1 0 0 0.1;
0 0 0 1 0 0;
0 0 0 0 1 0;
0 0 0 0 0 1]; % System Dynamics
in = cat(2,in1,in2);
X(:,1)=in(1,:)'; % Actual initial conditions
Z(:,1)=X(1:3,:);% initial observation
Xh(:,1)=X(:,1);%Assumed initial conditions
P(:,:,1)=[0.1 0 0 0 0 0;
0 0.1 0 0 0 0;
0 0 0.1 0 0 0;
0 0 0 0.1 0 0;
0 0 0 0 0.1 0;
0 0 0 0 0 0.1]; %inital value of covarience of estimation error
% plots
subplot(3,3,1)
xlabel('time')
ylabel('X')
title('X possition')
hold on
subplot(3,3,4)
xlabel('time')
ylabel('Y')
title('Y possition')
hold on
subplot(3,3,7)
xlabel('time')
ylabel('Z')
title('Z possition')
hold on
subplot(2,2,2)
xlabel('time')
title('Minimum MSE')
hold on
subplot(2,2,4)
plot3(0,0,0)
title('3-D trajectory ')
xlabel('X')
ylabel('Y')
zlabel('Z')
hold on
for n=1:100
%% PROCESS AND OBSERVATION PROCESS WITH GAUSSINA NOISE
X(:,n+1)=A*X(:,n)+[0;0;0;sqrt(Q(4,4))*randn(1);sqrt(Q(5,5))*randn(1);sqrt(Q(6,6))*randn(1)]; % State process % w generating process noise
Z(:,n+1)=[sqrt(X(1,n)^2+X(2,n)^2);arctang(X(2,n),X(1,n),ind);X(3,n)]+[sqrt(M(1,1))*randn(1);sqrt(M(1,1))*randn(1);sqrt(M(1,1))*randn(1)]; %generating & observation observation noise
%% prediction of next state
Xh(:,n+1)=A*Xh(:,n);% ESTIMATE
P(:,:,n+1)=A*P(:,:,n)*A'+Q;% PRIORY ERROR COVARIENCE
%% CORRECTION EQUTIONS
H(:,:,n+1)=[Xh(1,n+1)/(sqrt(Xh(1,n+1)^2+Xh(2,n+1)^2)), Xh(2,n+1)/(sqrt(Xh(1,n+1)^2+Xh(2,n+1)^2)),0,0,0,0; ...
-Xh(2,n+1)/(sqrt(Xh(1,n+1)^2+Xh(2,n+1)^2)), Xh(1,n+1)/(sqrt(Xh(1,n+1)^2+Xh(2,n+1)^2)),0,0,0,0; ...
0,0,1,0,0,0]; % Jacobian matrix
K(:,:,n+1)=P(:,:,n+1)*H(:,:,n+1)'*(M+H(:,:,n+1)*P(:,:,n+1)*H(:,:,n+1)')^(-1); % Kalman Gain
Inov=Z(:,n+1)-[sqrt(Xh(1,n+1)^2+Xh(2,n+1)^2);arctang(Xh(2,n+1),Xh(1,n+1),ind);Xh(3,n+1)];% INNOVATION
Xh(:,n+1)=Xh(:,n+1)+ K(:,:,n+1)*Inov; %computes final estimate
P(:,:,n+1)=(eye(6)-K(:,:,n+1)*H(:,:,n+1))*P(:,:,n+1);% %computes covarience of estimation error
%% unwrapping the tan function
theta1=arctang(Xh(1,n+1),Xh(2,n+1),0);
theta=arctang(Xh(1,n),Xh(2,n),0);
if abs(theta1-theta)>=pi
if ind==1
ind=0;
else
ind=1;
end
end
%% Some Plots
subplot(3,3,1)
line([n,n+1],[X(1,n),X(1,n+1)])
hold on
drawnow
subplot(3,3,4)
line([n,n+1],[X(2,n),X(2,n+1)])
hold on
drawnow
subplot(3,3,7)
line([n,n+1],[X(3,n),X(3,n+1)])
hold on
drawnow
subplot(2,2,4)
line([Xh(1,n) Xh(1,n+1)],[Xh(2,n) Xh(2,n+1)],[Xh(3,n) Xh(3,n+1)],'Color','r')
hold on
drawnow
line([X(1,n) X(1,n+1)],[X(2,n) X(2,n+1)],[X(3,n) X(3,n+1)])
hold on
drawnow
subplot(2,2,2)
line([n,n+1],[(X(1,n)-Xh(1,n))^2,(X(1,n+1)-Xh(1,n+1))^2])
hold on
drawnow
line([n,n+1],[(X(2,n)-Xh(2,n))^2,(X(2,n+1)-Xh(2,n+1))^2],'Color','r')
hold on
drawnow
line([n,n+1],[(X(3,n)-Xh(3,n))^2,(X(3,n+1)-Xh(3,n+1))^2],'Color','c')
hold on
drawnow
legend('X-MSE','Y-MSE','Z-MSE')
subplot(3,3,1)
line([n,n+1],[Xh(1,n),Xh(1,n+1)],'Color','r')
hold on
drawnow
subplot(3,3,4)
line([n,n+1],[Xh(2,n),Xh(2,n+1)],'Color','r')
hold on
drawnow
subplot(3,3,7)
line([n,n+1],[Xh(3,n),Xh(3,n+1)],'Color','r')
hold on
drawnow
end
%% arctang
function [ARG]=arctang(A,B,ind)
if B<0 && A>0 % PLACING IN THE RIGHT QUADRANT
ARG=abs(atan(A/B))+pi/2;
elseif B<0 && A<0
ARG=abs(atan(A/B))+pi;
elseif B>0 && A<0
ARG=abs(atan(A/B))+3*pi/2;
else
ARG=atan(A/B);
end
if ind==-1 % UNWARPPING PART
ARG=ARG-2*pi;
else
if ind==1;
ARG=ARG+2*pi;
end
end
end
end
in1 - position of object
-21.8318 19.2251 -16.0000
-21.4604 18.9727 -15.8555
-21.0925 18.7208 -15.7102
-20.7281 18.4693 -15.5639
-20.3671 18.2182 -15.4169
-20.0093 17.9676 -15.2692
-19.6547 17.7173 -15.1208
-19.3031 17.4674 -14.9717
-18.9545 17.2178 -14.8221
-18.6088 16.9687 -14.6719
-18.2658 16.7198 -14.5213
-17.9255 16.4714 -14.3702
-17.5879 16.2232 -14.2187
-17.2528 15.9755 -14.0669
-16.9203 15.7281 -13.9147
-16.5901 15.4811 -13.7623
-16.2623 15.2345 -13.6097
-15.9368 14.9883 -13.4569
-15.6135 14.7425 -13.3040
-15.2925 14.4971 -13.1509
-14.9735 14.2522 -12.9978
-14.6567 14.0078 -12.8446
-14.3420 13.7638 -12.6914
-14.0292 13.5204 -12.5383
-13.7185 13.2776 -12.3852
-13.4097 13.0353 -12.2322
-13.1028 12.7936 -12.0793
-12.7979 12.5525 -11.9266
-12.4948 12.3122 -11.7741
-12.1935 12.0725 -11.6218
-11.8941 11.8336 -11.4697
-11.5965 11.5954 -11.3179
-11.3007 11.3581 -11.1663
-11.0067 11.1216 -11.0151
-10.7144 10.8860 -10.8642
-10.4240 10.6513 -10.7137
-10.1353 10.4176 -10.5635
-9.8483 10.1850 -10.4138
-9.5631 9.9533 -10.2644
-9.2797 9.7228 -10.1155
-8.9980 9.4934 -9.9671
-8.7181 9.2652 -9.8191
-8.4399 9.0382 -9.6717
-8.1636 8.8125 -9.5247
-7.8890 8.5882 -9.3783
-7.6162 8.3652 -9.2325
-7.3452 8.1436 -9.0872
-7.0760 7.9234 -8.9424
-6.8087 7.7048 -8.7983
-6.5432 7.4877 -8.6548
-6.2795 7.2723 -8.5119
-6.0178 7.0584 -8.3696
-5.7579 6.8463 -8.2280
-5.5000 6.6359 -8.0870
-5.2440 6.4273 -7.9467
-4.9899 6.2206 -7.8071
-4.7378 6.0157 -7.6681
-4.4878 5.8127 -7.5299
-4.2397 5.6118 -7.3923
-3.9938 5.4128 -7.2555
-3.7499 5.2159 -7.1194
-3.5080 5.0211 -6.9841
-3.2684 4.8285 -6.8495
-3.0308 4.6380 -6.7156
-2.7955 4.4498 -6.5825
-2.5624 4.2639 -6.4502
-2.3315 4.0803 -6.3187
-2.1028 3.8990 -6.1879
-1.8765 3.7202 -6.0579
-1.6525 3.5438 -5.9287
-1.4308 3.3699 -5.8004
-1.2115 3.1985 -5.6728
-0.9946 3.0297 -5.5460
-0.7801 2.8635 -5.4200
-0.5681 2.6999 -5.2949
-0.3586 2.5390 -5.1706
-0.1516 2.3807 -5.0471
0.0528 2.2253 -4.9245
0.2547 2.0725 -4.8027
0.4539 1.9226 -4.6817
0.6506 1.7755 -4.5616
0.8446 1.6313 -4.4423
1.0358 1.4899 -4.3239
1.2244 1.3514 -4.2063
1.4103 1.2159 -4.0897
1.5934 1.0833 -3.9738
1.7737 0.9538 -3.8589
1.9512 0.8272 -3.7448
2.1258 0.7036 -3.6315
2.2976 0.5831 -3.5192
2.4665 0.4657 -3.4077
2.6326 0.3513 -3.2971
2.7956 0.2400 -3.1874
2.9558 0.1318 -3.0786
3.1130 0.0268 -2.9707
3.2672 -0.0751 -2.8636
3.4184 -0.1739 -2.7575
3.5665 -0.2695 -2.6522
3.7117 -0.3620 -2.5479
3.8537 -0.4513 -2.4444
3.9927 -0.5374 -2.3419
4.1287 -0.6204 -2.2402
4.2615 -0.7002 -2.1395
4.3912 -0.7768 -2.0397
4.5178 -0.8503 -1.9408
4.6413 -0.9205 -1.8428
4.7616 -0.9876 -1.7457
4.8788 -1.0516 -1.6495
4.9928 -1.1124 -1.5542
5.1036 -1.1700 -1.4599
5.2113 -1.2246 -1.3665
5.3158 -1.2760 -1.2740
5.4171 -1.3242 -1.1825
5.5153 -1.3694 -1.0919
5.6102 -1.4115 -1.0022
5.7020 -1.4506 -0.9135
5.7906 -1.4866 -0.8257
5.8760 -1.5195 -0.7388
5.9583 -1.5495 -0.6529
6.0373 -1.5765 -0.5679
6.1132 -1.6005 -0.4839
6.1860 -1.6216 -0.4008
6.2555 -1.6398 -0.3187
6.3220 -1.6551 -0.2376
6.3853 -1.6675 -0.1574
6.4455 -1.6772 -0.0781
6.5026 -1.6840 0.0001
6.5565 -1.6882 0.0774
6.6074 -1.6896 0.1538
6.6553 -1.6883 0.2291
6.7000 -1.6844 0.3035
6.7418 -1.6779 0.3769
6.7805 -1.6688 0.4493
6.8163 -1.6572 0.5207
6.8491 -1.6431 0.5911
6.8789 -1.6266 0.6606
6.9058 -1.6077 0.7290
6.9298 -1.5865 0.7965
6.9510 -1.5630 0.8629
6.9693 -1.5373 0.9283
6.9847 -1.5093 0.9927
6.9974 -1.4792 1.0562
7.0074 -1.4470 1.1185
7.0146 -1.4128 1.1799
7.0191 -1.3766 1.2403
7.0210 -1.3385 1.2996
7.0203 -1.2985 1.3579
7.0170 -1.2567 1.4151
7.0111 -1.2132 1.4714
7.0027 -1.1679 1.5265
6.9919 -1.1210 1.5807
6.9786 -1.0726 1.6338
6.9629 -1.0226 1.6858
6.9449 -0.9712 1.7368
6.9246 -0.9184 1.7867
6.9020 -0.8642 1.8356
6.8773 -0.8088 1.8834
6.8503 -0.7522 1.9301
6.8212 -0.6945 1.9758
6.7901 -0.6357 2.0204
6.7569 -0.5759 2.0639
6.7218 -0.5152 2.1064
6.6847 -0.4536 2.1478
6.6458 -0.3912 2.1881
6.6050 -0.3280 2.2273
6.5625 -0.2643 2.2654
6.5183 -0.1999 2.3024
6.4723 -0.1350 2.3383
6.4248 -0.0696 2.3732
6.3757 -0.0039 2.4069
6.3251 0.0622 2.4396
6.2731 0.1285 2.4711
6.2197 0.1950 2.5016
6.1649 0.2616 2.5309
6.1089 0.3283 2.5592
6.0516 0.3949 2.5863
5.9932 0.4614 2.6124
5.9337 0.5278 2.6373
5.8731 0.5940 2.6611
5.8116 0.6598 2.6839
5.7491 0.7253 2.7055
5.6857 0.7904 2.7261
5.6216 0.8549 2.7455
5.5566 0.9189 2.7638
5.4910 0.9823 2.7811
5.4248 1.0450 2.7972
5.3579 1.1070 2.8122
5.2906 1.1681 2.8262
5.2228 1.2284 2.8391
5.1546 1.2877 2.8508
5.0860 1.3461 2.8615
5.0172 1.4034 2.8712
4.9481 1.4596 2.8797
4.8789 1.5146 2.8872
4.8096 1.5684 2.8936
4.7402 1.6210 2.8990
4.6708 1.6722 2.9033
4.6014 1.7221 2.9066
4.5322 1.7706 2.9088
4.4631 1.8176 2.9100
4.3943 1.8631 2.9102
4.3257 1.9070 2.9094
4.2574 1.9494 2.9076
4.1895 1.9901 2.9047
4.1221 2.0292 2.9009
4.0551 2.0666 2.8961
3.9886 2.1022 2.8904
3.9226 2.1361 2.8837
3.8573 2.1682 2.8761
3.7927 2.1985 2.8676
3.7287 2.2270 2.8581
3.6655 2.2536 2.8478
3.6030 2.2783 2.8365
3.5414 2.3011 2.8244
3.4806 2.3221 2.8115
3.4207 2.3411 2.7978
3.3618 2.3582 2.7832
3.3038 2.3734 2.7679
3.2467 2.3867 2.7517
3.1907 2.3980 2.7349
3.1357 2.4075 2.7173
3.0818 2.4150 2.6990
3.0290 2.4207 2.6800
2.9773 2.4245 2.6604
2.9267 2.4264 2.6401
2.8772 2.4266 2.6192
2.8289 2.4249 2.5978
2.7817 2.4215 2.5758
2.7358 2.4164 2.5533
2.6910 2.4095 2.5303
2.6474 2.4011 2.5068
2.6049 2.3910 2.4829
2.5637 2.3794 2.4587
2.5236 2.3664 2.4340
2.4846 2.3519 2.4091
2.4469 2.3361 2.3838
2.4102 2.3190 2.3584
2.3747 2.3008 2.3327
2.3403 2.2814 2.3068
2.3069 2.2610 2.2808
2.2746 2.2397 2.2548
2.2433 2.2175 2.2287
2.2130 2.1946 2.2026
2.1836 2.1711 2.1765
2.1551 2.1472 2.1506
2.1274 2.1228 2.1248
2.1006 2.0982 2.0992
2.0745 2.0735 2.0739
2.0491 2.0487 2.0489
2.0243 2.0242 2.0242
2.0000 2.0000 2.0000
in2 - Velocity of Object
0.3714 -0.2524 0.1445
0.3679 -0.2519 0.1454
0.3644 -0.2515 0.1462
0.3610 -0.2511 0.1470
0.3578 -0.2507 0.1477
0.3546 -0.2503 0.1484
0.3516 -0.2499 0.1491
0.3486 -0.2495 0.1496
0.3457 -0.2492 0.1502
0.3430 -0.2488 0.1506
0.3403 -0.2485 0.1511
0.3376 -0.2481 0.1515
0.3351 -0.2478 0.1518
0.3326 -0.2474 0.1521
0.3302 -0.2470 0.1524
0.3278 -0.2466 0.1526
0.3255 -0.2462 0.1528
0.3233 -0.2458 0.1530
0.3211 -0.2454 0.1531
0.3189 -0.2449 0.1531
0.3168 -0.2444 0.1532
0.3148 -0.2439 0.1532
0.3127 -0.2434 0.1531
0.3107 -0.2429 0.1531
0.3088 -0.2423 0.1530
0.3069 -0.2417 0.1529
0.3050 -0.2410 0.1527
0.3031 -0.2404 0.1525
0.3012 -0.2397 0.1523
0.2994 -0.2389 0.1521
0.2976 -0.2382 0.1518
0.2958 -0.2373 0.1515
0.2940 -0.2365 0.1512
0.2922 -0.2356 0.1509
0.2905 -0.2347 0.1505
0.2887 -0.2337 0.1502
0.2870 -0.2327 0.1498
0.2852 -0.2316 0.1493
0.2834 -0.2305 0.1489
0.2817 -0.2294 0.1484
0.2799 -0.2282 0.1480
0.2781 -0.2270 0.1475
0.2764 -0.2257 0.1469
0.2746 -0.2244 0.1464
0.2728 -0.2230 0.1459
0.2710 -0.2216 0.1453
0.2692 -0.2201 0.1447
0.2673 -0.2186 0.1441
0.2655 -0.2171 0.1435
0.2636 -0.2155 0.1429
0.2618 -0.2138 0.1423
0.2599 -0.2121 0.1416
0.2579 -0.2104 0.1410
0.2560 -0.2086 0.1403
0.2540 -0.2068 0.1396
0.2521 -0.2049 0.1389
0.2501 -0.2030 0.1382
0.2480 -0.2010 0.1375
0.2460 -0.1990 0.1368
0.2439 -0.1969 0.1361
0.2418 -0.1948 0.1353
0.2397 -0.1926 0.1346
0.2375 -0.1904 0.1339
0.2353 -0.1882 0.1331
0.2331 -0.1859 0.1323
0.2309 -0.1836 0.1315
0.2286 -0.1812 0.1308
0.2263 -0.1788 0.1300
0.2240 -0.1764 0.1292
0.2217 -0.1739 0.1284
0.2193 -0.1714 0.1276
0.2169 -0.1688 0.1268
0.2145 -0.1662 0.1260
0.2120 -0.1636 0.1251
0.2095 -0.1609 0.1243
0.2070 -0.1582 0.1235
0.2044 -0.1555 0.1226
0.2019 -0.1527 0.1218
0.1993 -0.1499 0.1210
0.1966 -0.1471 0.1201
0.1940 -0.1442 0.1193
0.1913 -0.1414 0.1184
0.1886 -0.1385 0.1176
0.1858 -0.1355 0.1167
0.1831 -0.1326 0.1158
0.1803 -0.1296 0.1150
0.1775 -0.1266 0.1141
0.1747 -0.1236 0.1132
0.1718 -0.1205 0.1123
0.1689 -0.1175 0.1115
0.1660 -0.1144 0.1106
0.1631 -0.1113 0.1097
0.1601 -0.1082 0.1088
0.1572 -0.1051 0.1079
0.1542 -0.1019 0.1070
0.1512 -0.0988 0.1061
0.1482 -0.0956 0.1053
0.1451 -0.0925 0.1044
0.1421 -0.0893 0.1035
0.1390 -0.0861 0.1025
0.1359 -0.0830 0.1016
0.1328 -0.0798 0.1007
0.1297 -0.0766 0.0998
0.1266 -0.0734 0.0989
0.1235 -0.0703 0.0980
0.1203 -0.0671 0.0971
0.1172 -0.0640 0.0962
0.1140 -0.0608 0.0952
0.1108 -0.0577 0.0943
0.1077 -0.0545 0.0934
0.1045 -0.0514 0.0925
0.1013 -0.0483 0.0915
0.0981 -0.0452 0.0906
0.0950 -0.0421 0.0897
0.0918 -0.0390 0.0887
0.0886 -0.0360 0.0878
0.0854 -0.0330 0.0869
0.0822 -0.0300 0.0859
0.0791 -0.0270 0.0850
0.0759 -0.0240 0.0840
0.0727 -0.0211 0.0831
0.0696 -0.0182 0.0821
0.0664 -0.0153 0.0812
0.0633 -0.0125 0.0802
0.0602 -0.0096 0.0792
0.0571 -0.0069 0.0783
0.0540 -0.0041 0.0773
0.0509 -0.0014 0.0763
0.0478 0.0013 0.0754
0.0448 0.0039 0.0744
0.0417 0.0065 0.0734
0.0387 0.0091 0.0724
0.0357 0.0116 0.0714
0.0328 0.0141 0.0704
0.0298 0.0165 0.0694
0.0269 0.0189 0.0684
0.0240 0.0212 0.0674
0.0211 0.0235 0.0664
0.0183 0.0258 0.0654
0.0155 0.0279 0.0644
0.0127 0.0301 0.0634
0.0099 0.0322 0.0624
0.0072 0.0342 0.0614
0.0045 0.0362 0.0603
0.0019 0.0381 0.0593
-0.0007 0.0400 0.0583
-0.0033 0.0418 0.0573
-0.0059 0.0436 0.0562
-0.0084 0.0453 0.0552
-0.0108 0.0469 0.0541
-0.0133 0.0485 0.0531
-0.0157 0.0500 0.0520
-0.0180 0.0514 0.0510
-0.0203 0.0528 0.0499
-0.0226 0.0541 0.0489
-0.0248 0.0554 0.0478
-0.0269 0.0566 0.0467
-0.0291 0.0577 0.0457
-0.0311 0.0588 0.0446
-0.0332 0.0598 0.0435
-0.0351 0.0607 0.0425
-0.0371 0.0616 0.0414
-0.0389 0.0624 0.0403
-0.0408 0.0631 0.0392
-0.0425 0.0638 0.0381
-0.0443 0.0644 0.0370
-0.0459 0.0649 0.0359
-0.0475 0.0654 0.0348
-0.0491 0.0657 0.0337
-0.0506 0.0661 0.0326
-0.0520 0.0663 0.0316
-0.0534 0.0665 0.0305
-0.0548 0.0666 0.0294
-0.0560 0.0667 0.0283
-0.0573 0.0666 0.0271
-0.0584 0.0665 0.0260
-0.0595 0.0664 0.0249
-0.0606 0.0661 0.0238
-0.0616 0.0659 0.0227
-0.0625 0.0655 0.0216
-0.0634 0.0651 0.0205
-0.0642 0.0646 0.0194
-0.0649 0.0640 0.0183
-0.0656 0.0634 0.0172
-0.0663 0.0627 0.0161
-0.0668 0.0620 0.0150
-0.0673 0.0611 0.0140
-0.0678 0.0603 0.0129
-0.0682 0.0593 0.0118
-0.0685 0.0583 0.0107
-0.0688 0.0573 0.0096
-0.0691 0.0562 0.0086
-0.0692 0.0550 0.0075
-0.0693 0.0538 0.0064
-0.0694 0.0526 0.0054
-0.0694 0.0512 0.0043
-0.0693 0.0499 0.0033
-0.0692 0.0485 0.0022
-0.0691 0.0470 0.0012
-0.0689 0.0455 0.0002
-0.0686 0.0440 -0.0008
-0.0683 0.0424 -0.0018
-0.0679 0.0407 -0.0028
-0.0675 0.0391 -0.0038
-0.0670 0.0374 -0.0048
-0.0665 0.0357 -0.0057
-0.0659 0.0339 -0.0067
-0.0653 0.0321 -0.0076
-0.0647 0.0303 -0.0085
-0.0640 0.0285 -0.0095
-0.0632 0.0266 -0.0103
-0.0624 0.0247 -0.0112
-0.0616 0.0228 -0.0121
-0.0608 0.0209 -0.0129
-0.0599 0.0190 -0.0138
-0.0590 0.0171 -0.0146
-0.0580 0.0152 -0.0154
-0.0570 0.0133 -0.0161
-0.0560 0.0114 -0.0169
-0.0550 0.0094 -0.0176
-0.0539 0.0076 -0.0183
-0.0528 0.0057 -0.0190
-0.0517 0.0038 -0.0196
-0.0506 0.0020 -0.0203
-0.0495 0.0001 -0.0209
-0.0483 -0.0017 -0.0214
-0.0471 -0.0034 -0.0220
-0.0460 -0.0051 -0.0225
-0.0448 -0.0068 -0.0230
-0.0436 -0.0085 -0.0235
-0.0424 -0.0100 -0.0239
-0.0413 -0.0116 -0.0243
-0.0401 -0.0131 -0.0246
-0.0389 -0.0145 -0.0250
-0.0378 -0.0158 -0.0252
-0.0366 -0.0171 -0.0255
-0.0355 -0.0183 -0.0257
-0.0344 -0.0194 -0.0259
-0.0334 -0.0204 -0.0260
-0.0323 -0.0213 -0.0261
-0.0313 -0.0222 -0.0261
-0.0303 -0.0229 -0.0261
-0.0294 -0.0235 -0.0260
-0.0285 -0.0240 -0.0259
-0.0276 -0.0244 -0.0258
-0.0268 -0.0246 -0.0256
-0.0261 -0.0247 -0.0253
-0.0254 -0.0247 -0.0250
-0.0248 -0.0245 -0.0247
-0.0243 -0.0242 -0.0242
1.0000 1.0000 1.0000