Bodylight.js

Bodylight.js

  • Docs
  • GitHub

›Simple project

Getting started

  • Introduction
  • Compiling Modelica

Simple project

  • Creating a simple project
  • Adding the model
  • Visualisation
  • Controls
  • Events and Actions

Physiological application

  • Pressure volume cardiac simulator
  • Creating the layout
  • Adding the heart
  • Heart Beat
  • Controls
  • Phases
  • Pressure volume chart
  • Rolling charts
  • Custom actions
  • Buttons
  • Finishing touches

API

  • Model
  • Plotly chart
  • Range
  • Toggle

Adding the model

Firstly we should look at our model, it is fairly straight-forward since the only outputs we need are sinus and cosinus.

within ;
model Lissajous
  parameter Real sinus_shift = 0;
  parameter Real cosinus_shift = 0;  
  parameter Real sinus_frequency = 1;
  parameter Real cosinus_frequency = 1;
  Real sinus;
  Real cosinus;

equation
  sinus = Modelica.Math.sin(
    (time + sinus_shift) * sinus_frequency
  );
  cosinus = Modelica.Math.cos(
    (time + cosinus_shift) * cosinus_frequency
  );
end Lissajous;

Start by downloading the model, this file contains compiled code which the Composer can run. More information about the compilation process can be found in compiling Modelica.

Adding the model

Drag&Drop the Model Widget anywhere to the main composer window.

And then upload the model .zip file in the displayed drop area.

You should see the model variables and parameters in the right Connect panel.

Model Parameters

← Creating a simple projectVisualisation →
  • Adding the model
Copyright © 2019 Creative Connections s.r.o.