Error in nlgreyest about 'cell' type input arguments
Show older comments
I am trying to create a Nonlinear Grey box model. My model has one output, 1 state, and three inputs. The creation of idnlgrey object runs without any problem.
%% representing iddata
u = [Ps_FMU, Ts_FMU, mdots_FMU]; % inputs of the system
z = iddata(Tout, u, 10); % sampling time of 10s
%% Creating idnlgrey model object
order = [1 3 1]; %[#output, #inputs, #states]
param0 = -1*ones(21, 1);
state0 = 0;
nlgr = idnlgrey('dis_nlgr_model', order, param0, state0, 0);
but when I try to estimate the parameters I get this error : The error message is: "Undefined function 'mtimes' for input arguments of type 'cell'."
opt = nlgreyestOptions('Display','on');
nlgr_est = nlgreyest(z, nlgr, opt);
The function I have defined for the nonlinear model is('dis_nlgr_model'):
function [dx, y] = dis_nlgr_model(t, x, u, eta0, eta1, eta2, eta3, rho0,...
rho1, mu11, mu12, mu21, mu22, A0, A1, A2, A3, B1, B2, B3, C11, C12, C21, C22, w)
dx = eta0 + eta1 * u(2) + eta2 * u(2) ^ 2 + eta3 * u(2) ^ 3 +...
rho0 + rho1 * u(1) +...
mu11 * exp(mu12 * u(3)) + mu21 * exp(mu22 * u(3)); % State derivative function
eff = A0 +...
A1 * cos(w * x) + B1 * sin(w * x) +...
A2 * cos(2 * w * x) + B2 * sin(2 * w * x) +...
A3 * cos(3 * w * x) + B3 * sin(3 * w * x) +...
C11 * exp(C12 * u(3)) + C21 * exp(C22 * u(3));
y = -eff * (u(2) - 273) + u(2); % Output function
end
Answers (0)
Categories
Find more on Grey-Box Model Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!