IDGREYMODEL - Too many inputs - but only one input - Help please

조회 수: 3 (최근 30일)
Lara Hammer
Lara Hammer 2019년 11월 7일
이동: Cris LaPierre 2024년 9월 27일
Hi,
I am trying to make a grey box model for my thermal network of a zone. I get the error
Error using idgrey (line 372)
The ODE function "Thermalzone" could not be evaluated successfully using the given set of parameters, sample time and optional arguments.
The error message generated during the evaluation was:
Too many input arguments.
Error in graamodell (line 7)
sys = idgrey(odefun,parameters,fcn_type);
However Ionly have one Input. I cant see how this is happening.
The code I have made is here:
%For the ODE function thermal zone
function [A,B,C,D] = Thermalzone(R1C1)
A=-1/(R1C1);
B=transpose([1/(R1C1), 1/(R1C1), 1/(R1C1), 1/(R1C1)]);
C=1;
D=transpose([0 0 0 0]);
end
%For the ID grey model
odefun = 'Thermalzone';
R1C1=0.3*0.4;
parameters={'R1C1', R1C1;};
fcn_type = 'c';
sys = idgrey(odefun,parameters,fcn_type);

채택된 답변

Jalaj Gambhir
Jalaj Gambhir 2019년 11월 11일
Hi,
The first issue is the missing Ts parameter. The value of Ts parameter is set based on the value of ‘fcnType’ (if not provided inside idgrey). Have a look here. But solving this issue alone does not solve the problem.
The next issue is the usage of transpose in the variables ‘B’ and ‘D’. The sizes for the terms should be consistent while solving the ODE. The matrix shape expected are mentioned here. The correct function definition:
%For the ODE function thermal zone
function [A, B, C, D] = Thermalzone(R1C1,Ts)
A= -1/(R1C1);
B= [1/(R1C1), 1/(R1C1), 1/(R1C1), 1/(R1C1)];
C= 1;
D= [0 0 0 0];
end
%For the ID grey model
odefun = 'Thermalzone';
R1C1=0.3*0.4;
parameters={'R1C1', R1C1};
fcn_type = 'c';
sys = idgrey(odefun,parameters,fcn_type);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by