I get the following error: "The number of inputs and outputs of the model must match that of the data." However, I have ensured the number of outputs are definitely correct – where have I gone wrong?
NB: y= 100×3, u=100×1
load v1v2;y=[x_store simSoC_TECM];u=simCurr_TECM;data = iddata(y,u,1,'Name','Battdata'); %y=O/P (V1,V2), u=I/P (Ibat), Ts=1.
data.OutputName = {'BattV1','BattV2','BattSoc'};data.OutputUnit = {'V','V','%'};data.Tstart = 0;data.TimeUnit = 's';%%load parameters
load rcbranchR1=RpTF1mean(5,3);R2=RpTF2mean(5,3);T1=TauTF1mean(5,3);T2=TauTF2mean(5,3);R0=RoTFmean(5,3);C1=T1/R1;C2=T2/R2;%%construct greybox model
param = {T1;T2;C1;C2;Cnom;R0}linm = idgrey('batteryeq_lin',param,'c'); function [A,B,C,D] = batteryeq_lin(T1,T2,C1,C2,Cnom,R0,Ts)A=[-1/T1 0 0;0 -1/T2 0;0 0 0]; %(V1 V2 SOC)
B=[1/C1;1/C2;-1/Cnom];C=[-1 -1 -1];D=R0;%%Specify known and unknown parameters.
for i=1:1:5linm.Structure.Parameters(i).Free = false;endlinm.Structure.Parameters(6).Free = true;linm.Structure.Parameters(6).Minimum = 45e-3;linm.Structure.Parameters(6).Maximum = 90e-3;%%Estimate R0.
ticlinm = greyest(data,linm)toc
Thank you
Best Answer