-
-
Notifications
You must be signed in to change notification settings - Fork 45
Define Voltage, Current #51
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
Conversation
- Adds tests to verify shape + dimension way of defining sources
@ChrisRackauckas can you approve the workflow runs? |
@ChrisRackauckas can you approve the workflow runs one more time? Also, now this PR is ready. |
Codecov Report
@@ Coverage Diff @@
## main #51 +/- ##
==========================================
- Coverage 71.77% 68.51% -3.26%
==========================================
Files 23 23
Lines 1024 918 -106
==========================================
- Hits 735 629 -106
Misses 289 289
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Can you please add the smooth signal definitions to |
_square_wave(t, δ, f, A, st) = A*2atan(sin(2π*(t-st)*f)/δ)/π | ||
_step(t, δ, h, a) = h*(atan((t-a)/δ)/π + 0.5) | ||
_triangular_wave(t, δ, f, A, st) = A*(1-2acos((1 - δ)sin(2π*(t-st)*f))/π) | ||
_xH(t, δ, tₒ) = (t-tₒ)*(1+((t-tₒ)/sqrt((t-tₒ)^2+δ^2)))/2 |
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.
Don't throw these away.
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.
I want to move them to Blocks. (But with a separate PR)
- Remove extra spaces in analog & thermal tests - Add spaces in rotational tests - Add broken test for ramp-voltage/current
Now that #59 is complete, once that is merged, I'll add tests with Triangular and Square sources + Voltage/Current |
- Attempt to increase overall codecoverage %
end | ||
end | ||
|
||
# RL with different voltage sources |
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.
Why remove this test?
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.
We already test Voltage, Current + all different sources in
- "Current function generators"
- "Voltage function generators"
- RC with current sources
- RC with voltage sources (I added this one to see if that improces code-cov; but that didn't seem to affect)
That's why I removed RL tests with all sources (simple RL is still around)
Do we want to keep this around?
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.
No it's ok I think, as long as the RL test is there.
|
||
A source in which the current through its terminals is a square function of time. | ||
Acts as current signal. |
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.
Add a description about the convention of a positive current, i.e. which port has inflowing current if I
is positive.
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.
Also here, it is an ideal current source with no internal resistance.
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.
Acts as an ideal current signal with no internal resistance modeled.
No further effects are modeled. Especially, the current flow will never end.
The inflowing current `I` is observed at the positive pin `p`
# States
- `i(t)`: [`A`]
The output current
# Connectors
- `p`
Positive pin
- `n`
Negative pin
- `I`
Input
Is this better?
|
||
Acts as voltage signal. |
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.
Be more specific.
It is an ideal arbitrary waveform generator with no internal resistance, i.e. can source infinite currents.
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 an ideal arbitrary Voltage waveform generator with no internal resistance, i.e. can source infinite currents.
# States
- `v(t)`: [`V`]
The voltage across this component
# Connectors
- `p`
Positive pin
- `n`
Negative pin
- `V`
Input
This removes a bunch of components from Electrical/Analog/Sources and hence is breaking. |
Voltage
,Current
signals in Electrical moduleThis finishes up the decoupling of Analog devices from shapes (from deprecated #18)
(While here, comments
Short