ModelingToolkitStandardLibrary.jl icon indicating copy to clipboard operation
ModelingToolkitStandardLibrary.jl copied to clipboard

fix: change variable defaults to guesses

Open avinashresearch1 opened this issue 1 year ago • 6 comments

Checklist

  • [ ] Appropriate tests were added
  • [x] Any code changes were done in a way that does not break public API
  • [x] All documentation related to code changes were updated
  • [ ] The new code follows the contributor guidelines, in particular the SciML Style Guide and COLPRAC.
  • [ ] Any new documentation only uses public API

Additional context

Add any other context about the problem here.

avinashresearch1 avatar Apr 11 '24 20:04 avinashresearch1

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
@@            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.

codecov[bot] avatar Apr 11 '24 20:04 codecov[bot]

@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 avatar Apr 11 '24 21:04 avinashresearch1

@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 avatar Apr 12 '24 13:04 avinashresearch1

Rebased after @AayushSabharwal 's changes #291

avinashresearch1 avatar May 03 '24 12:05 avinashresearch1

@baggepinnen request for review

avinashresearch1 avatar May 03 '24 13:05 avinashresearch1

Where is this at?

ChrisRackauckas avatar Jun 13 '24 14:06 ChrisRackauckas