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
Walter Roberson 2015년 12월 2일

0 개 추천

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.

댓글 수: 1

MJ
MJ 2015년 12월 16일
Thanks walter, but i know the form of "idnlgrey" command.as u know,"m-file' defined in differential or difference equations, but i want to define regressory nonlinear model in "m-file". i dont know how do it...?

댓글을 달려면 로그인하십시오.

카테고리

제품

질문:

MJ
2015년 12월 2일

댓글:

MJ
2015년 12월 16일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by