ModiaSim/TinyModia.jl

I try to execute TinyModia but not work ...

abassign opened this issue · 2 comments

I installed TinyModia ModiaBase and ModiaPlot on Julia 1.6.1 in Linux Ubuntu.
I tried running this example, but it crashes on "Var" ... I can't figure out where I'm going wrong.

ulia> using TinyModia

julia> using ModiaBase

julia> using ModiaPlot

julia> # Cartesian pendulum model. 
       CPendulum = Model(
           L = Var(1.0, parameter=true),
           m = Var(1.0, parameter=true),
           g_n = Var(9.80665, parameter=true),

           x = Var(init=1/sqrt(2)),
           y = Var(init=-1/sqrt(2)),
           vx = Var(),
           vy = Var(),
           F = Var(),
           
           equation = :[  
               der(x) = vx
               der(y) = vy
         
               m*der(vx) = (F/L)*x
               m*der(vy) = (F/L)*y - m*g_n
         
               x^2 + y^2 = L^2]
       )
ERROR: UndefVarError: Var not defined
Stacktrace:
 [1] top-level scope
   @ REPL[54]:2

For some reason, the version of TinyModia in the registry seems to refer to 0.7.0. Try updating TinyModia via ]add TinyModia@v0.7.2. That worked for me the other day.

Hello,

I tried, but I got the same errors, then I deleted the .julia directory (in my home, I use as OS, Ubuntu 21.04) and relaunched Julia which at this point is in the basic configuration.
I then installed
] add TinyModia@v0.7.2

And everything worked perfectly :)

But now there is a problem :( I had to reset the previous configuration that I use for a Julia application that I have been writing for several weeks ... The application is used by several users around the world ( https://github.com/abassign/Photoscenary ) and hence it becomes difficult to manage my program with these issues.

Your application is of great interest to me for
implement an alternative FDM (Flight Dynamics Model) to the one we are using now written in C ++ for the Flight Gear flight simulator. In fact, I would like to use Modia software as a real-time flight management system. Unfortunately Modelica is too heavy to be used in RT, considering that an airplane simulation requires hundreds of modules including dozens of PIDs.
We currently use as a simulation software RT JSBSim which is based on the CSMP models which was the subject of my thesis in mechanical engineering.
https://jsbsim-team.github.io/jsbsim/index.html

I'd also like to be able to think about using Modelica's GUI and link it with Modia using the same method.

What do you think about it ?

Could it be a project that makes sense?

Greetings

Adriano