SciML / SciML/ModelingToolkitStandardLibrary.jl

Add units

Open
#90 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
171
Forks
49
Avg merge
15h 50m
Merged PRs (30d)
10

Description

MTK now supports units (via Unitful).
The standard library should support these as well:

# Parameters:
- `T`: [K] Fixed temperature boundary condition
"""
function FixedTemperature(; name, T)
    @named port = HeatPort()
    pars = @parameters T = T [unit=u"K"]
    eqs = [
        port.T ~ T,
    ]
    ODESystem(eqs, t, [], pars; systems = [port], name = name)
end

better yet, inputs should allow units:

@named fixed = FixedTemperature(T=30u"°C")

with unit translation done internally.

Best would be for MTK to deal with units (and not require inputs to be stripped)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, or entry point is identified in the issue. First clarify whether unit handling belongs in the standard library or MTK, and define the supported input and translation behavior. Done should include standard-library support for units and a clear decision on whether inputs such as T=30u"°C" are accepted without stripping units.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.