Skip to content

A switch variable in startup.jl? If not enabled, do not parse the code string unit = u"V" to avoid Unit buggs #3248

@wang890

Description

@wang890

Is your feature request related to a problem? Please describe.

Unit system is only auxiliary to modeling and solving, but useful. Many variables from Blocks have no Units, so it is very troublesome to balance the units when equation solving. Currently, Unit only have a display function before solving.

In addtion, there are still some Issues about the Unit System, which may be improved in the future when there is time. Is it necessary to have mtk provide a switch variable? If this variable is not enabled, the code string of Unit metadata like unit = u"V" will not be parsed to avoid unnecessary buggs like the issue #3247.

Describe the solution you’d like
Perhaps, the switch variable can be placed in .julia\config\startup.jl as a global variable, or some other user-settable way. startup.jl needs to be created manually.

Additional context
My temporary Unit solution like unit = u("Resistance") had been described at the issue comment.
After I learned Julia macro and mtk, I would also like to contribute some code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions