Pendulum working

This commit is contained in:
2026-03-09 13:01:56 +01:00
parent e580b9840e
commit fbc61e9fb2
9 changed files with 145 additions and 83 deletions

41
vis2d.mo Normal file
View File

@@ -0,0 +1,41 @@
model vis2d
import Modelica.Mechanics.MultiBody.Visualizers;
import Modelica.Mechanics.MultiBody.Frames;
parameter Real L = 1;
parameter Real w = 0.02;
parameter Real orbRadius = 0.04;
input Real r[3];
input Real phi;
Visualizers.Advanced.Shape link(
shapeType = "cylinder",
length = L,
width = w,
height = w,
r_shape = {-L / 2, 0, 0},
lengthDirection = {1, 0, 0},
widthDirection = {0, 1, 0},
r = r,
R = Frames.from_T(
[cos(phi), -sin(phi), 0;
sin(phi), cos(phi), 0;
0, 0, 1],
zeros(3)));
Visualizers.Advanced.Shape orb(
shapeType = "sphere",
length = 2 * orbRadius,
width = 2 * orbRadius,
height = 2 * orbRadius,
r_shape = {L / 2 - orbRadius, 0, 0},
lengthDirection = {1, 0, 0},
widthDirection = {0, 1, 0},
r = r,
R = Frames.from_T(
[cos(phi), -sin(phi), 0;
sin(phi), cos(phi), 0;
0, 0, 1],
zeros(3)));
end vis2d;