Skip to content

Adds input/output meta data #81

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

Merged
merged 3 commits into from
Jun 19, 2022

Conversation

ValentinKaisermayer
Copy link
Contributor

Removes pesky warnings that the connector contains (non-flow, non-stream, non-input, non-output) variables but no flow variable.

fix initial value

Adds initial values

Revert change

Makes amplitude smaller
@ValentinKaisermayer
Copy link
Contributor Author

Can we please separate the irreducability from the inputs?
It can not be that this simple system with one state has five states in MTK.

@named c = Constant(; k=2)
@named gain = Gain(1;)
@named int = Integrator(; k=1)
@named fb = Feedback(;)
@named model = ODESystem(
    [
        connect(c.output, fb.input1), 
        connect(fb.input2, int.output), 
        connect(fb.output, gain.input),
        connect(gain.output, int.input),
    ], 
    t, 
    systems=[int, gain, c, fb]
)
sys = structural_simplify(model)

julia> sys
Model model with 5 equations
States (5):
  int₊x(t) [defaults to 0.0]
  int₊input₊u(t) [defaults to 0.0]
  gain₊input₊u(t) [defaults to 0.0]

Parameters (3):
  int₊k [defaults to 1]
  gain₊k [defaults to 1]
  c₊k [defaults to 2]
Incidence matrix:5×6 SparseArrays.SparseMatrixCSC{Num, Int64} with 10 stored entries:
 ×    ×      
           ×
   ×      ×  
       ×  ×  ×
     ×  ×    

@YingboMa

@codecov
Copy link

codecov bot commented Jun 19, 2022

Codecov Report

Merging #81 (e4eb600) into main (c9af29e) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #81   +/-   ##
=======================================
  Coverage   69.06%   69.06%           
=======================================
  Files          23       23           
  Lines         931      931           
=======================================
  Hits          643      643           
  Misses        288      288           
Impacted Files Coverage Δ
src/Blocks/math.jl 100.00% <100.00%> (ø)
src/Blocks/utils.jl 61.53% <100.00%> (ø)
src/Thermal/HeatTransfer/ideal_components.jl 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@ChrisRackauckas ChrisRackauckas merged commit 1100e95 into SciML:main Jun 19, 2022
@ValentinKaisermayer ValentinKaisermayer deleted the patch-io branch June 19, 2022 19:33
@baggepinnen
Copy link
Contributor

The input should only be considered irreducible if !is_bound(state)

@ValentinKaisermayer
Copy link
Contributor Author

ValentinKaisermayer commented Jun 20, 2022

The input should only be considered irreducible if !is_bound(state)

https://github.com/SciML/ModelingToolkit.jl/blob/fd279c0377da50331fe920d6dd62f2816e60b02d/src/variables.jl#L30

isirreducible(x) = isvarkind(VariableIrreducible, x) || (isinput(x) && !is_bound(x))

@ValentinKaisermayer
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants