Cosimulation with MATLAB and Simulink

I am attempting to connect Pulse with MATLAB and Simulink as part of the COVIDBreathSim project. The howto project seems to be a good place to start, but I am having trouble getting the application to run on Windows 10. I followed the Wiki and (presume) successfully created the Pulse engine static libraries. I then tried to use CMake (first time user) to set up a MSVC 2015 project for the SDK. It did not find the Pulse build directory, so I added those manually. Still, I end up with an inscrutable error from the build process.

I tabled that and created my own MSVC project, added the include paths and libraries, and I eventually got a howto-like build. When I try to run that build within Visual Studio, I end up with an exception at m_Engine.GetEngineTracker()->TrackData(m_Engine.GetSimulationTime(TimeUnit::s));
The comes during the HowToMechanicalVentilation() call.

(I did already change the working directory to the \bin of my built Pulse installation to find the config files)

When I run the test exe at the console in the installation directory, I get this output:
[INFO] : [0(s)] HowToMechanicalVentilation
[INFO] : [0(s)] Tidal Volume : 527.076mL
[INFO] : [0(s)] Systolic Pressure : 113.753mmHg
[INFO] : [0(s)] Diastolic Pressure : 73.0416mmHg
[INFO] : [0(s)] Heart Rate : 73.1707bpm
[INFO] : [0(s)] Respiration Rate : 12bpm
[INFO] : [0(s)] Oxygen Saturation : 0.974336
FATAL:Unknown Data Request : RespirationMusclePressure :
[FATAL] : [0.02(s)] Unknown Data Request : RespirationMusclePressure

Are there any related known issues with the 2.3.0 release?


I believe you are trying to request “RespiratoryMusclePressure”

List of strings for respiratory data requests are here:

Indeed, that was the issue! Please note that I was working off your example in HowTo-MechanicalVentilation.cpp. It requests 2 data items that are apparently out of date with this list:
RespirationMusclePressure (now RespiratoryMusclePressure) and PulmonaryResistance, which now appears separated into Inspiratory and ExpiratoryPulmonaryResistance. I made those updates and was able to simulate.


Thanks for letting us know!

I would also suggest to checkout the feature/multiplex_ventilation branch
(Branched off of 3.x)

This is also a pretty good resource for CMake

The 3.x has a much improved CMake system
You should be able to use the find_package and set the Pulse_DIR to the install/lib/cmake/PulseXXX folder to get its CMake interface target for use in your projects

Sorry we were late in responding
Post Pulse questions here :

The Pulse teams gets notifications for posts there and respond pretty quickly

Privacy Notice