Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

I try to execute TinyModia but not work ... #9

Open
abassign opened this issue Jun 3, 2021 · 2 comments
Open

I try to execute TinyModia but not work ... #9

abassign opened this issue Jun 3, 2021 · 2 comments

Comments

@abassign
Copy link

abassign commented Jun 3, 2021

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
@crlaugh
Copy link

crlaugh commented Jun 3, 2021

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

@abassign
Copy link
Author

abassign commented Jun 4, 2021

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 [email protected]

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants