-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolve #2116 Sources with variable frequency #3049
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the sources from Modelica.Electrical.Analog.Sources (for example SignalVoltage) also inherit from the new source icons?
@beutlich As far as I see, all sources inherit from partial VoltageSource or CurrentSource, and these inherit from the same icons. So the icons are defined only once. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is o.k. to me.
Just wait a little bit with merging, |
…amplitude implemented sine signal source with variable frequency and amplitude
Just wait an hour or two, I'll provide two nice examples. |
…ovide a second example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two questions:
- Why is only a new sine block added, but no cosine block?
- Should SineVariableFrequencyAndAmplitude really go to Blocks.Sources, since it is the only block having inputs? Could also go to Blocks.Math.
@beutlich It's more a source. You may define frequency and amplitude constant, or prescribe them via inputs. |
@beutlich There's also only an ExpSine, not ExpCosine. |
I've also improved the icon. |
I've added cosine with variable frequency and variable amplitude |
This is a resolution to fix #2116
Before doing that, I removed the "encapsulated" from 3 examples (don't know why that was used).
To implement the voltage and current source with the same icon, I moved the icons form the partial models to a new Icon package.
Implementation is robust. Parameter startTime omitted, since this affects the initial phase shift (which can be initialized anyway) and if the sine should start later, you could keep the amlitude to zero until the sine should start.
To test the sources, there are 2 new examples.