Skip to content
Snippets Groups Projects
Commit 121ae751 authored by Kenneth Guldbrandt Lausdahl's avatar Kenneth Guldbrandt Lausdahl
Browse files

added notes

parent fe3ba81e
No related branches found
No related tags found
No related merge requests found
model MassSpringDamper1
parameter Real c1 = 1;
parameter Real d1 = 1;
parameter Real m1 = 1;
output Real x1(start = 1);
output Real v1(start = 0);
input Real fk;
equation
der(x1) = v1;
der(v1) = 1 / m1 * ((-c1 * x1) - d1 * v1 + fk);
end MassSpringDamper1;
model MassSpringDamper2
parameter Real c2 = 1;
parameter Real d2 = 2;
parameter Real cc = 1;
parameter Real dc = 100;
parameter Real m2 = 1;
input Real x1(start = 1);
input Real v1(start = 0);
output Real x2(start = 0);
output Real v2(start = 0);
output Real fk;
equation
fk = cc * (x2 - x1) + dc * (x2 - x1);
der(x2) = v2;
der(v2) = 1 / m2 * ((-c2 * x2) - d2 * v2 - fk);
end MassSpringDamper2;
model MassSpringDampersScenario
MassSpringDamper1 msd1;
MassSpringDamper2 msd2;
output Real x1;
output Real v1;
output Real x2;
output Real v2;
output Real fk;
equation
msd1.fk = msd2.fk;
msd2.x1 = msd1.x1;
msd2.v1 = msd1.v1;
x1 = msd1.x1;
v1 = msd1.v1;
x2 = msd2.x2;
v2 = msd2.v2;
fk = msd2.fk;
annotation(experiment(StartTime = 0, StopTime = 10, Tolerance = 0.001, Interval = 0.02));
end MassSpringDampersScenario;
I'm taking these values from the analysis done in the report.
I attach the experiments with the appropriate constants that I found best for the experiment.
These values assume a Jacobi-like master, but may not be guaranteed to be stable because of some nuances that you may have in the algorithm (also, the finite representation was not taken into account).
Stable:
m1 = m2 = c1 = c2 = d1 = cc = dc = 1
d2 = 2
fixed cosim step_size = 0.001
Unstable:
m1 = m2 = c1 = c2 = d1 = cc = 1
d2 = 2
dc = from 100 onwards (6E6 will make it unstable for sure!)
fixed cosim step_size = 0.001
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment