Skip to content
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

Simplify temperature dependency for analog components #349

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

langestefan
Copy link
Contributor

@langestefan langestefan commented Dec 23, 2024

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • 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

This simplifies some of the component definitions, similar to how they are defined in Modelica.

For example, in Modelica the resistor has a useHeatPort boolean argument which adds a temperature dependency.

This means HeatingDiode and HeatingResistor components are removed, but Resistor and Diode now incorporate optional temperature-dependent behavior. By default temperature dependency is disabled, so Resistor(R=1.0) can be called as usual.

@langestefan langestefan marked this pull request as ready for review December 23, 2024 23:46
@ChrisRackauckas
Copy link
Member

Looks like there's a QA test failure? Other than that it looks good to go.

@matthew-kapp
Copy link
Contributor

@ChrisRackauckas @langestefan Is this a new fail or an existing fail. I get the following error during test on main (no changes):

Testing Running tests... Unbound type parameters detected: [1] var"#__VariableResistor__#18"(name, T_dep, enforce_bounds, R_ref::Union{Missing, Nothing, ModelingToolkit.NoValue, var"##608"}, T_ref::Union{Missing, Nothing, ModelingToolkit.NoValue, var"##609"}, R_const::Union{Missing, Nothing, ModelingToolkit.NoValue, var"##610"}, pos::Union{Missing, Nothing, ModelingToolkit.NoValue, Real}, R::Union{Missing, Nothing, ModelingToolkit.NoValue, var"##611"}, alpha::Union{Missing, Nothing, ModelingToolkit.NoValue, var"##612"}, ::typeof(ModelingToolkitStandardLibrary.Electrical.__VariableResistor__)) where {var"##608", var"##609", var"##610", var"##611", var"##612"} @ ModelingToolkitStandardLibrary.Electrical none:0 Aqua: Test Failed at C:\Users\matth\.julia\packages\Aqua\epbUr\src\unbound_args.jl:37

@langestefan
Copy link
Contributor Author

This PR is not merged so it's not related.

@ChrisRackauckas
Copy link
Member

Can you rebase this? It would be easier to see it against main which now has some more fixed tests.

@langestefan
Copy link
Contributor Author

Can you rebase this? It would be easier to see it against main which now has some more fixed tests.

I see some things are failing due to unbound type parameters. I have no clue what that is but I'll try to figure it out and fix it.

Perhaps we could setup a proper pre-commit flow to catch these sorts of things at the development side.

@matthew-kapp
Copy link
Contributor

@langestefan could you please remove 'unit =' and just have the 'description ='. I also don't quite understand the error, but I figured out this is the root cause of this and previous Aqua/QA failures (Unbound Error).

@langestefan
Copy link
Contributor Author

@langestefan could you please remove 'unit =' and just have the 'description ='. I also don't quite understand the error, but I figured out this is the root cause of this and previous Aqua/QA failures (Unbound Error).

Yes I saw that as well. Should be fixed now. There should still be CI failures but they should not be related to this PR.

@ChrisRackauckas
Copy link
Member

It looks like lots of new tests are failing here?

@langestefan
Copy link
Contributor Author

langestefan commented Mar 8, 2025

None of those seem to have anything to do with this PR?

For example I see:

 └ @ ModelingToolkit ~/.julia/packages/ModelingToolkit/CvDvM/src/systems/diffeqs/abstractodesystem.jl:1446
driven spring damper mass: Error During Test at 
/home/runner/work/ModelingToolkitStandardLibrary.jl/ModelingToolkitStandardLibrary.jl/test/Mechanical/translational.jl:72
  Got exception outside of a @test
  ArgumentError: Equations (5), unknowns (4), and initial conditions (4) are of different lengths.

and:

 └ @ ModelingToolkit ~/.julia/packages/ModelingToolkit/CvDvM/src/systems/diffeqs/abstractodesystem.jl:1446
Blocks: analysis points: Error During Test at /home/runner/.julia/packages/SafeTestsets/raUNr/src/SafeTestsets.jl:30
  Got exception outside of a @test
  LoadError: Analysis point outer₊inner_plant_input not found in system outer.
  Stacktrace:

are these new tests that were never run?

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