Create transmissionlinecircuits.jl#153
Open
aa25desh wants to merge 6 commits into
Open
Conversation
mforets
requested changes
Jul 26, 2019
Member
|
This model can be defined parametric in |
mforets
reviewed
Jul 26, 2019
lbenet
reviewed
Jul 27, 2019
Contributor
Author
|
Yes, Indeed once we fix on equations, inv, guard I will do that.
…On Sat, 27 Jul, 2019, 2:50 PM Luis Benet, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In models/TransmissionLineCircuit/transmissionlinecircuits.jl
<#153 (comment)>
:
> +using Plots
+
***@***.*** function transmission_line_circuits_one!(t, x, dx)
+ local α = 5
+ dx[1] = -2*x[1] + x[2] + 2 - exp(α*x[1]) - exp(α*(x[1] - x[2])) + x[7]
+ dx[2] = -2*x[2] + x[1] + x[3] + exp(α*(x[1] - x[2])) - exp(α*(x[2] - x[3]))
+ dx[3] = -2*x[3] + x[2] + x[4] + exp(α*(x[2] - x[3])) - exp(α*(x[3] - x[4]))
+ dx[4] = -2*x[4] + x[3] + x[5] + exp(α*(x[3] - x[4])) - exp(α*(x[4] - x[5]))
+ dx[5] = -2*x[5] + x[4] + x[6] + exp(α*(x[4] - x[5])) - exp(α*(x[5] - x[6]))
+ dx[6] = -x[6] + x[5] -1 + exp(α*(x[5] - x[6]))
+ return dx
+end
+
***@***.*** function transmission_line_circuits_two!(t, x, dx)
+ local α = 5
+ dx[1] = -2*x[1] + x[2] + 2 - exp(α*x[1]) - exp(α*(x[1] - x[2])) + x[7]
@taylorize will be unable to produce fast code, unless the operations are
unary or binary. While it is ok to have -2*x[1]+x[2], because this is
parsed as (-(2*x[1]))+x[2], this is not the case for more than two
additions. If you want that this runs fast, you should include parenthesis
enforcing the unary/binary operations. This comment applies essentially to
all lines of your equations of motion.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#153?email_source=notifications&email_token=AHBGTUWUYNGIXOBODYX2ECDQBQHPHA5CNFSM4IG6URO2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB7YSP5I#pullrequestreview-267462645>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHBGTUTUVSJIIQUXRTY3VZTQBQHPHANCNFSM4IG6UROQ>
.
|
mforets
requested changes
Jul 27, 2019
mforets
requested changes
Jul 27, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
left the invariant and guards dummy for time being.