Comments (1)
@instantiateModel fails when the Model contains Unitful quantities, as in the pendulum example in the README.
The pendulum example in the README file is available as Modia/examples/Pendulum.jl. When executing it on my (Windows) machine, it translates and simulates correctly.
The docu in Unitful states:
By default, exponents on units or dimensions are indicated using Unicode superscripts on macOS and without superscripts on other operating systems. You can set the environment variable UNITFUL_FANCY_EXPONENTS to either true or false to force using or not using the exponents.
So, you are probably working on macOS. It feels a bit dangerous that a global environment variable is set inside Modia. It would be better to extend Modia, so that units with exponents are also correctly handled on macOS without setting this environment variable. When inspecting https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts it seems quite complicated to support this, because there are Unicode superscripts for a large set of characters. We also have no access to macOS, and cannot test such a bug fix.
The simplest solution is probably to follow your suggestion, so set ENV["UNITFUL_FANCY_EXPONENTS"]=false on macOS when entering @instantiateModel, and additionally print a warning message, if ENV["UNITFUL_FANCY_EXPONENTS"] was not set or has a value of true on macOS.
from modia.jl.
Related Issues (20)
- Issue with inferring initial conditions for variables used in der() HOT 2
- numerical constant and spaces in equation HOT 1
- Problem with ModiaPlot dependencies
- I am studying this product, but it is incredibly problematic with the version compatibility of other very common libraries, such as JuliaDB. HOT 1
- I would like to use Modia in real-time applications ... does it make sense, is it possible? HOT 2
- linearize!(model, analytic=true, ... HOT 2
- equations = :[ ] ... observation
- dead-time function HOT 1
- ModiaLang v0.8.2 - missing feature in main branch HOT 1
- issue with "m.x_init" HOT 3
- Modia.jl 0.6.1 instantiatemodel fails HOT 4
- Bool parameter converted to Float64 HOT 1
- error when using SVector and SMatrix HOT 1
- Modia crashing "using Modia" HOT 4
- time consuming function "addToResult!"
- docs: How to describe the Map function? HOT 1
- Link to documentation broken HOT 1
- [help] Implementing a basic NPN BJT model HOT 2
- Precompilation fails HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modia.jl.