

In examples/tutorial_files/MATLAB-FOQUS/Tutorial_2
LATIN HYPERCUBE SAMPLING GIVEN BOUNDS MATLAB CODE
Below is an example of the code that needs to be executed. Step 4: Create a new MATLAB script to call the matlab_foqus_script.m file (which is distributed with FOQUS and can be found in examples/tutorial_files/MATLAB-FOQUS/Tutorial_2),Īnd pass to it the MATLAB function containing the model. Step 3: Select the new generated UQ_Ensemble and click on Save Selected to save the ensemble as a PSUADE file. Step 2: Follow step 6 from the Tutorial 1: MATLAB - FOQUS direct section to generate a new simulation ensemble. Users need to take care when defining the MATLAB functionįor the model in step 3 as it is necessary to define the MATLAB function inputs in the same order as were defined in the FOQUS flowsheet. The initial sample is drawn using Latin hypercube sampling, and the target. Step 1: Follow steps 1-3 from the Tutorial 1: MATLAB - FOQUS direct section. sampling and MCMC simulation, and provides a MATLAB code of the Random Walk. Tutorial 2: MATLAB script implementation ¶ Latin Hypercube sampling method with 100 samples, and then generate the samples. Fix all variables except the volume, which will be a variable with bounds 50-150 l. Step 7: Under the uncertainty tab in FOQUS, select Add New option to generate a new simulation ensemble. Step 6: Run the node simulation to test if the simulation is working properly. CSTR_Steady_State ( inputs, nargout = 1 ) # Retrieve outputs to Foqus f = outputs f = outputs f = outputs f = outputs f = outputs f = outputs f = outputs double (, x, x, x, x, x, x, x, x, x, x, x, x, x ]) # Call the Matlab function outputs = eng. addpath ( MATLAB_DIR ) # Create a matlab array object with input parameters inputs = matlab. connect_matlab ( 'MatlabEngine' ) # Add current directory to Matlab path eng. # Import the Matlab Engine import matlab.engine # Directory with the Matlab function MATLAB_DIR = "C: \\ Users \\ yancycd \\ MATLAB-FOQUS" # Create a matlab engine object and connect to the opened matlab session eng = matlab. The conversion of reactant A is defined as: The variables in the system of equations are described below: Variable
