Process Integration and Design Optimization

Process Integration and Design Optimization

Connecting OptiSLang with Simulink using Matlab node

    • viv_vid
      Subscriber

      I am trying to connect OptiSLang to my Simulink model. I have successfully established the connection. I now want to perform sensitivity analysis on this model and I have three parameters on which I want to run parameter sweeps for 300 samples in OptiSLang. I took help from one of the examples used and made the matlab script as seen:

      Here F_o_fy, F_o_fx and F_o_fz are the parameters. Now when I click Run for the sensitivity analysis I am getting this following error message :

      So OptiSLang does changes the value of each parameters according to the range set but then goes back to the default initial value. Why is this happening? Is there something that needs to be changed in the MATLAB script?

      Any help would be appreciated.

      Thankyou.

      Vivek

    • Veit Bayer
      Subscriber

      Hi viv_vid,

      The concept of these lines is as follows: if the script is called by MATLAB outside optiSLang, the variable OSL_REGULAR_EXECUTION does not exist. If you do a Test Run when editing the Matlab node, it is set to false, in a regular run of the workflow it is set to true by optiSLang. This way, you have on the one hand default values to run the script outside optiSLang context, on the other hand you avoid that design values generated by optiSLang are overwritten. Your code looks good so far.

      Still, the values of F_o_f* are overwritten. I suspect it happens elsewhere in the code. Outside the code snippet we see above, you shouldn't touch these variables. Please check your code for this.

      /Veit

       

Viewing 1 reply thread
  • You must be logged in to reply to this topic.