Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5957971
commit c427c9c
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
simulation/modelica/algorithms_functions/TestCrossFunction.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// status: correct | ||
|
||
loadModel(Modelica);getErrorString(); | ||
loadString("model TestCrossFunction | ||
import Modelica.Mechanics.MultiBody.Frames; | ||
Frames.Orientation R = Frames.nullRotation(); | ||
Real v1[3], v2[3]; | ||
|
||
function f | ||
input Frames.Orientation R; | ||
input Real v1[3]; | ||
output Real v2[3]; | ||
algorithm | ||
v2 := Frames.resolveRelative(cross(Frames.angularVelocity2(R), v1), R, R); | ||
end f; | ||
|
||
equation | ||
v1 = {0, 0, 0}; | ||
v2 = f(R, v1); | ||
end TestCrossFunction;");getErrorString(); | ||
buildModel(TestCrossFunction);getErrorString(); | ||
|
||
// Result: | ||
// true | ||
// "" | ||
// true | ||
// "" | ||
// {"TestCrossFunction","TestCrossFunction_init.xml"} | ||
// "" | ||
// endResult |