how to write a discrete function for grey-box
显示 更早的评论
Hi there...
i have a model regressory like below that i want to put it in my "m-file.m" as a function of idnlgrey command.
midnlgrey = idnlgrey(m-file.m,de)
my regresory model is :
y1(t) = 0.33*u2(t)*x1(t-1)^(1.34)+1.82*u1(t)+-0.01*u3(t)*u2(t)+1.3*x2(t-2);
y2(t) = 0.6*u2(t)-0.16*x1(t-1)^(9/8)+x2(t-1);
y3(t) = 1.65*u3(t)+3*u2(t-1)^2+u3(t-2)+7*u2(t-2);
how can i write above regressory equations as discrete function for idnlgrey command.
thank you
回答(1 个)
Walter Roberson
2015-12-2
midnlgrey = idnlgrey('m_file', de)
You do not need to specify the '.m' extension
Notice that I renamed m-file.m to m_file.m . The name needs to be the name of a function and "-" is not permitted in the name of MATLAB functions.
The file m_file.m would have to start with
function [dx, y] = m_file(t,x,u,p1,p2, ...,pN)
where the number of p* arguments depends upon the number of parameters you need.
I cannot tell at the moment which of your u1, u2, u3, x1, x2, x3 are intended to be inputs, and which are intended to be states, and which are intended to be functions so I will not suggest the code for your m_file.m at this time.
类别
在 帮助中心 和 File Exchange 中查找有关 Nonlinear Grey-Box Models 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!