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

2 vues (au cours des 30 derniers jours)
Lara Hammer
Lara Hammer le 7 Nov 2019
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);

Réponse acceptée

Jalaj Gambhir
Jalaj Gambhir le 11 Nov 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);
  1 commentaire
Lara Hammer
Lara Hammer le 14 Nov 2019
Déplacé(e) : Cris LaPierre le 27 Sep 2024
Thank YOU! It worked!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Oceanography and Hydrology dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by