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

5 visualizaciones (últimos 30 días)
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);

Respuesta aceptada

Jalaj Gambhir
Jalaj Gambhir el 11 de Nov. de 2019
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);

Más respuestas (1)

Lara Hammer
Lara Hammer el 14 de Nov. de 2019
Thank YOU! It worked!

Categorías

Más información sobre Model Predictive Control Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by