-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestOp.m
More file actions
91 lines (72 loc) · 2.09 KB
/
testOp.m
File metadata and controls
91 lines (72 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
%% Operating Point Test
%GNU General Public License v3.0
%By Stefan Thanheiser: https://orcid.org/0000-0003-2765-1156
%
%Part of the paper:
%
%Thanheiser, S.; Haider, M.
%Dispersion Model for Level Control of Bubbling Fluidized Beds with
%Particle Cross-Flow
%Chemical Engineering Research and Design 2025
%
%All data, along with methodology reports and supplementary documentation,
%is published in the data repository:
%https://doi.org/10.5281/zenodo.7924693
%
%All required files for this script can be found in the software
%repository:
%https://doi.org/10.5281/zenodo.7948224
%
%
%
%This script can be used to test whether an operating point created by the
%"calcRobust" script is actually in stationary conditions. It requires the
%operating points stored in the "oppoints.mat" file created by the script
%"calcRobust".
%
%
%Required products, version 24.1:
% - MATLAB
% - Simulink
% - Requirements Toolbox
% - Simulink Real-Time
% - Stateflow
%Necessary files, classes, functions, and scripts:
% - @DryAir
% - @FluBed
% - @implExp
% - @Sinter
% - getBIC.m
% - mdlPostLoadFx.m
% - loadGeometry.m
% - getMdotSstatic.m
% - dynamicModel.slx
% - oppoints.mat
%% Set point to check
opIdx=23; %Index in the operating point grid
paramIdx=5; %Index in the parameter grid
%% Load
%Dynamic model
mdl='dynamicModel';
sys=load_system(mdl);
mdlPostLoadFx;
%Operating points and parameter grids
load('oppoints.mat');
%% Check operating point
%Boundary conditions
poro=0.47; %Bed porosity (constant)
p0=101325; %Ambient pressure (constant)
Phigate=hGate./href.*rho_p.*(1-poro)+p0./(FluBed.g.*href); %Weir boundary condition
%Get dispersion model parameters
c=cGrid(paramIdx);
eps2=eps2Grid(paramIdx);
eps3=eps3Grid(paramIdx);
epsAr=epsArGrid(paramIdx);
%Get operating point boundary and initial conditions
point=op{opIdx}(paramIdx);
uInit=getinputstruct(point);
xInit=getstatestruct(point);
%Simulate operating point
minSimTime=100; %Ensure short simulation
out=sim(sys,'LoadExternalInput','on','ExternalInput','uInit',...
'LoadInitialState','on','InitialState','xInit');