Page 1 of 1

Optimization of calculation-intense Simulation using Matlab

PostPosted: Wed May 26, 2021 10:00 am
by kfisher@strattechnologies.com
Hello,

I am utilizing the Cameo Simulation toolkit in a slightly unconventional way.
I have reverse engineered a Matlab script into CSM. The simulation contain a number of loops, which each execute >100 times and contain linear algebra equations in Matlab language opaque actions. I am utilizing value properties (in context) as well as activity properties to have access to all of the values I need for the decision nodes and Matlab calculations.

The problem is, it is taking literally >12 hours to run the simulation. Are there ways to optimize the performance of the simulation? I am not aware of how values are loaded into memory, if they are cached, etc.
My maximum heap size is set to 20,000.

Thank you

Re: Optimization of calculation-intense Simulation using Matlab

PostPosted: Wed May 26, 2021 11:45 am
by saulius_p
Hello,

Good to talk to you!

What language do you use to execute equations in Cameo?

How long same calculation takes to execute in Matlab?

Sincerely,
Saulius

Re: Optimization of calculation-intense Simulation using Matlab

PostPosted: Thu May 27, 2021 8:31 am
by kfisher@strattechnologies.com
Thank you for the response, Saulius!

I am using mostly Matlab, because I require matrix operations for eigenvalues, ctranspose, dot product, etc. My default language is JavaScript, but I am also using Built-in-Math for some opaque expressions.
I have tried to speed things up by combining 3 or 4 Matlab expressions in a single opaque action, but even so, each opaque action takes ~1 second to complete, and because I am looping through a number of them thousands of time, it adds up.