SciML / ModelingToolkitStandardLibrary.jl

A standard library of components to model the world and beyond
https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/
MIT License
121 stars 37 forks source link

fix: change variable defaults to guesses #281

Closed avinashresearch1 closed 1 month ago

avinashresearch1 commented 6 months ago

Checklist

Additional context

Add any other context about the problem here.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 0% with 31 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (3a8fb0a) to head (6e2af95). Report is 7 commits behind head on main.

:exclamation: Current head 6e2af95 differs from pull request most recent head f000b3d

Please upload reports for the commit f000b3d to get more accurate results.

Files Patch % Lines
src/Blocks/utils.jl 0.00% 29 Missing :warning:
src/Blocks/continuous.jl 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #281 +/- ## ========================================== - Coverage 61.48% 0.00% -61.49% ========================================== Files 46 32 -14 Lines 1472 1657 +185 ========================================== - Hits 905 0 -905 - Misses 567 1657 +1090 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

avinashresearch1 commented 6 months ago

@ven-k I'm a little confused as to what is causing the test failure, its from the code below:

@mtkmodel SISO begin
           @parameters begin
               u_start = 0.0
               y_start = 0.0
           end
           @variables begin
               u(t), [guess = u_start, description = "Input of SISO system"]
               y(t), [guess = y_start, description = "Output of SISO system"]
           end
           @components begin
               input = RealInput(u_start = u_start)
               output = RealOutput(u_start = y_start)
           end
           @equations begin
               u ~ input.u
               y ~ output.u
           end
       end

its due to guess = u_start, not sure why it says u_start not defined when I'm trying to use the one in the params (I'm not extremely familiar with the @mtkmodel syntax).

avinashresearch1 commented 6 months ago

@ven-k I'm a little confused as to what is causing the test failure, its from the code below:

@mtkmodel SISO begin
           @parameters begin
               u_start = 0.0
               y_start = 0.0
           end
           @variables begin
               u(t), [guess = u_start, description = "Input of SISO system"]
               y(t), [guess = y_start, description = "Output of SISO system"]
           end
           @components begin
               input = RealInput(u_start = u_start)
               output = RealOutput(u_start = y_start)
           end
           @equations begin
               u ~ input.u
               y ~ output.u
           end
       end

its due to guess = u_start, not sure why it says u_start not defined when I'm trying to use the one in the params (I'm not extremely familiar with the @mtkmodel syntax).

This requires: https://github.com/SciML/ModelingToolkit.jl/pull/2501

avinashresearch1 commented 6 months ago

Rebased after @AayushSabharwal 's changes #291

avinashresearch1 commented 6 months ago

@baggepinnen request for review

ChrisRackauckas commented 4 months ago

Where is this at?