INTO-CPS-Association / DTaaS-examples

Examples to demonstrate the features of DTaaS software
https://into-cps-association.github.io/DTaaS/development/user/examples/index.html
3 stars 8 forks source link

Electroingenium #22

Closed alq-eium closed 9 months ago

alq-eium commented 10 months ago

Main changes:

prasadtalasila commented 9 months ago

@alq-eium , I've solved the issue with glibc 2.31. Instead of installing a newer glibc, I've installed openmodelica in the workspace and exported the compatible FMU. After doing that, the log seems fine. Please check below:

▶ python client-asyncua.py
Client connected successfully

Model Info

  FMI Version        2.0
  FMI Type           Model Exchange, Co-Simulation
  Model Name         Test_DTCONEDAR
  Description
  Platforms          c-code, linux64
  Continuous States  0
  Event Indicators   0
  Variables          120
  Generation Tool    OpenModelica Compiler OpenModelica 1.22.1
  Generation Date    2023-12-23T08:07:28Z

Default Experiment

  Stop Time          1.0
  Tolerance          1e-06

Variables (input, output)

  Name               Causality              Start Value  Unit     Description
  abs_in             input                         30.0           [1/m]
  concOutA1_1        output
  concOutA1_2        output
  concOutA1_3        output
  concOutA1_4        output
  concOutA1_5        output
  concOutA1_6        output
  concOutA1_7        output
  concOutA2_1        output
  concOutA2_2        output
  concOutA2_3        output
  concOutA2_4        output
  concOutA2_5        output
  concOutA2_6        output
  concOutA2_7        output
  concOutA3_1        output
  concOutA3_2        output
  concOutA3_3        output
  concOutA3_4        output
  concOutA3_5        output
  concOutA3_6        output
  concOutA3_7        output
  concOutC_1         output
  concOutC_2         output
  concOutC_3         output
  concOutC_4         output
  concOutC_5         output
  concOutC_6         output
  concOutC_7         output
  power[1]           input                        100.0           [%]
  power[2]           input                        100.0           [%]
  power[3]           input                        100.0           [%]
  rho_a1_in          input                     100000.0           [UFC/100ml]
  rho_a2_in          input                      10000.0           [UFC/100ml]
  rho_a3_in          input                       1000.0           [UFC/100ml]
  rho_c_in           input                          0.1           [ml(H2O2)/L]
  vel_prof[1,1]      input                         10.0
  vel_prof[1,2]      input                         10.0
  vel_prof[1,3]      input                         10.0
  vel_prof[1,4]      input                         10.0
  vel_prof[1,5]      input                         10.0
  vel_prof[1,6]      input                         10.0
  vel_prof[1,7]      input                         10.0
  vel_prof[1,8]      input                         10.0
  vel_prof[2,1]      input                         10.0
  vel_prof[2,2]      input                         10.0
  vel_prof[2,3]      input                         10.0
  vel_prof[2,4]      input                         10.0
  vel_prof[2,5]      input                         10.0
  vel_prof[2,6]      input                         10.0
  vel_prof[2,7]      input                         10.0
  vel_prof[2,8]      input                         10.0
  vel_prof[3,1]      input                         10.0
  vel_prof[3,2]      input                         10.0
  vel_prof[3,3]      input                         10.0
  vel_prof[3,4]      input                         10.0
  vel_prof[3,5]      input                         10.0
  vel_prof[3,6]      input                         10.0
  vel_prof[3,7]      input                         10.0
  vel_prof[3,8]      input                         10.0
  vel_prof[4,1]      input                         10.0
  vel_prof[4,2]      input                         10.0
  vel_prof[4,3]      input                         10.0
  vel_prof[4,4]      input                         10.0
  vel_prof[4,5]      input                         10.0
  vel_prof[4,6]      input                         10.0
  vel_prof[4,7]      input                         10.0
  vel_prof[4,8]      input                         10.0
  vel_prof[5,1]      input                         10.0
  vel_prof[5,2]      input                         10.0
  vel_prof[5,3]      input                         10.0
  vel_prof[5,4]      input                         10.0
  vel_prof[5,5]      input                         10.0
  vel_prof[5,6]      input                         10.0
  vel_prof[5,7]      input                         10.0
  vel_prof[5,8]      input                         10.0
  vel_prof[6,1]      input                         10.0
  vel_prof[6,2]      input                         10.0
  vel_prof[6,3]      input                         10.0
  vel_prof[6,4]      input                         10.0
  vel_prof[6,5]      input                         10.0
  vel_prof[6,6]      input                         10.0
  vel_prof[6,7]      input                         10.0
  vel_prof[6,8]      input                         10.0
  vel_prof[7,1]      input                         10.0
  vel_prof[7,2]      input                         10.0
  vel_prof[7,3]      input                         10.0
  vel_prof[7,4]      input                         10.0
  vel_prof[7,5]      input                         10.0
  vel_prof[7,6]      input                         10.0
  vel_prof[7,7]      input                         10.0
  vel_prof[7,8]      input                         10.0
  vel_prof[8,1]      input                         10.0
  vel_prof[8,2]      input                         10.0
  vel_prof[8,3]      input                         10.0
  vel_prof[8,4]      input                         10.0
  vel_prof[8,5]      input                         10.0
  vel_prof[8,6]      input                         10.0
  vel_prof[8,7]      input                         10.0
  vel_prof[8,8]      input                         10.0
  vel_prof[9,1]      input                         10.0
  vel_prof[9,2]      input                         10.0
  vel_prof[9,3]      input                         10.0
  vel_prof[9,4]      input                         10.0
  vel_prof[9,5]      input                         10.0
  vel_prof[9,6]      input                         10.0
  vel_prof[9,7]      input                         10.0
  vel_prof[9,8]      input                         10.0
  vel_prof[10,1]     input                         10.0
  vel_prof[10,2]     input                         10.0
  vel_prof[10,3]     input                         10.0
  vel_prof[10,4]     input                         10.0
  vel_prof[10,5]     input                         10.0
  vel_prof[10,6]     input                         10.0
  vel_prof[10,7]     input                         10.0
  vel_prof[10,8]     input                         10.0
  vfr                input                      0.20833           [m3/s]
None
Simulating Test_DTCONEDAR.fmu (FMI: Version = 2.0, Type = ['ModelExchange', 'CoSimulation'])...
Simulation time = 0.5 ---------- Real time = 0.500378
Simulation time = 1.0 ---------- Real time = 1.000318
Simulation time = 1.5 ---------- Real time = 1.500359
Simulation time = 2.0 ---------- Real time = 2.000587
Simulation time = 2.5 ---------- Real time = 2.500404
Simulation time = 3.0 ---------- Real time = 3.00032
Simulation time = 3.5 ---------- Real time = 3.5003
Simulation time = 4.0 ---------- Real time = 4.000607
Simulation time = 4.5 ---------- Real time = 4.500343
Simulation time = 5.0 ---------- Real time = 5.000306
Simulation time = 5.5 ---------- Real time = 5.500311
Simulation time = 6.0 ---------- Real time = 6.000577
Simulation time = 6.5 ---------- Real time = 6.500311
Simulation time = 7.0 ---------- Real time = 7.000303
Simulation time = 7.5 ---------- Real time = 7.500303
Simulation time = 8.0 ---------- Real time = 8.000603
Simulation time = 8.5 ---------- Real time = 8.500327
Simulation time = 9.0 ---------- Real time = 9.000306
Simulation time = 9.5 ---------- Real time = 9.500293
Simulation time = 10.0 ---------- Real time = 10.000529
Client disconnected
(base)
prasadtalasila commented 9 months ago

In addition to the pip commands in the README, I had to do:

apt-get install build-essential libssl-dev libffi-dev python3-dev
pip install pyopenssl --upgrade

for the example to work.

alq-eium commented 9 months ago

Thank you @prasadtalasila , I will update the README. Regarding the additional commands, I think that it will happen again if we change the Operating System or the Python version since in a VM with Ubuntu 22.04.3 it works with pyOpenSSL version 23.3.0. Maybe the the best way to ensure that all needed Python libraries are installed, is to export a requirements.txt and import it, instead of typing the libraries by hand:

  1. Exporting:
    pip freeze > requirements.txt
  2. Importing:
    pip install requirements.txt

I will do it in a clean Python environment for the Linux version of DTaaS

prasadtalasila commented 9 months ago

Thanks.

alq-eium commented 9 months ago

Hi Prasad these are the updates:

prasadtalasila commented 9 months ago

@alq-eium Thanks for the updates. I will check these tomorrow and merge it.