- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » "force sweep"
"force sweep"
Re: "force sweep"
I didn't really find a sources that make this possible but you can try to make your own source:
just copy the code from Modelica.Blocks.Sources.Sine and add it into a new model
and then modify the code for example by adding the factor (time - startTime):
block Sine "Generate sine signal"
parameter Real amplitude=1 "Amplitude of sine wave";
parameter Modelica.SIunits.Frequency freqHz(start=1) "Frequency of sine wave";
parameter Modelica.SIunits.Angle phase=0 "Phase of sine wave";
parameter Real offset=0 "Offset of output signal";
parameter Modelica.SIunits.Time startTime=0 "Output = offset for time < startTime";
extends Modelica.Blocks.Interfaces.SO;
protected
constant Real pi=Modelica.Constants.pi;
equation
// y=offset + (if time < startTime then 0 else amplitude*Modelica.Math.sin(2*pi*freqHz*(time - startTime) + phase));
y=offset + (if time < startTime then 0 else Modelica.Math.sin(2*pi*freqHz*(time - startTime)^2 + phase));
end Sine;
To use this as a force you can connect it to Modelica.Mechanics.Translational.Sources.Force
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » "force sweep"