|
@@ -0,0 +1,56 @@
|
|
|
+semantic adaptation reactive mealy WindowSA windowSA
|
|
|
+at "./path/to/WindowSA.fmu"
|
|
|
+
|
|
|
+ for inner fmu Window window
|
|
|
+ at "./path/to/Window.fmu"
|
|
|
+ with input ports Real displacement (rad), Real speed (rad/s), Real reaction_force (N)
|
|
|
+ with output ports Real height (m), Real reaction_torque (N.m)
|
|
|
+
|
|
|
+input ports Real reaction_force,
|
|
|
+ Real displacement,
|
|
|
+ Real speed
|
|
|
+
|
|
|
+output ports Real disp,
|
|
|
+ Real tau
|
|
|
+
|
|
|
+param Real INIT_WINDOWSA_REACTION_FORCE := 0.0,
|
|
|
+ Real INIT_WINDOWSA_DISPLACEMENT := 0.0,
|
|
|
+ Real INIT_WINDOWSA_SPEED := 0.0,
|
|
|
+ Real INIT_WINDOW_REACTION_TORQUE := 0.0,
|
|
|
+ Real INIT_WINDOW_REACTION_HEIGHT := 0.0;
|
|
|
+
|
|
|
+control rules {
|
|
|
+ var Real H_window := do_step(window, t, H);
|
|
|
+ return H_window;
|
|
|
+}
|
|
|
+
|
|
|
+in var Real stored_windowsa_reaction_force := INIT_WINDOWSA_REACTION_FORCE,
|
|
|
+ Real stored_windowsa_displacement := INIT_WINDOWSA_DISPLACEMENT,
|
|
|
+ Real stored_windowsa_speed := INIT_WINDOWSA_SPEED;
|
|
|
+
|
|
|
+in rules {
|
|
|
+ true -> {
|
|
|
+ stored_windowsa_reaction_force := windowSA.reaction_force;
|
|
|
+ stored_windowsa_displacement := windowSA.displacement;
|
|
|
+ stored_windowsa_speed := windowSA.speed;
|
|
|
+ } --> {
|
|
|
+ window.reaction_force := stored_windowsa_reaction_force;
|
|
|
+ window.displacement := stored_windowsa_displacement;
|
|
|
+ window.speed := stored_windowsa_speed;
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
+out var Real stored_window_reaction_torque := INIT_WINDOW_REACTION_TORQUE,
|
|
|
+ Real stored_window_height := INIT_WINDOW_REACTION_HEIGHT;
|
|
|
+
|
|
|
+out rules {
|
|
|
+ true -> {
|
|
|
+ stored_window_reaction_torque := window.reaction_torque;
|
|
|
+ stored_window_height := window.height;
|
|
|
+ } --> {
|
|
|
+ windowSA.disp := stored_window_height / 100;
|
|
|
+ };
|
|
|
+ true -> { } --> {
|
|
|
+ windowSA.tau := -stored_window_reaction_torque;
|
|
|
+ };
|
|
|
+}
|