Dear Community,
i want create a time dependent variable (which represent my young modul and Stiffness of a beam in a Simscape model).
I want to change the stiffness during the simulation depending on the time.
I can not simply connect my stiffness variable to the Simscape block.
First i tried to do it with a signal builder, but was not albe to save the output into a variable.
Then i tried to run the simulation with a matlab script. But i was not able to define the variables during the simulation. So the problem is that first he run the simulation and then he modify the parameter.
my script:
clc
clear all
close all hidden
a=1
b=1
sim('simscapemodel_stiffness')
t=ans.time.Time
if t<1
a=500
b=20
else
a=20
b=500
end
a,b are the stiffness variables of two seperate bodies.
I am no expert in matlab, so there is a possibility that i already made some mistakes... but without the stiffness parameters the model is fine.
Hope you can help me thank you!
Viktor