Trouble with idgrey constructor in R2012b: Structure object modification slow

1 visualizzazione (ultimi 30 giorni)
After switching to R2012b from R2009b I have trouble porting my identification scripts. How can I create a "Structure" for use with the idgrey constructro as mentioned in the idgrey doc? If I just use a struct of the correct format, the constructor requests me to hand over an "pmodel.LinearODE" object, but how do I create one?
If I create and idgrey object with a dummy parameter vector
mymodel = idgrey('modelfilename', ones(1,np), 'c', aux );
and then try to assign the parameter values and ranges afterward, there is no list expandsion and I end up using a loop
for inp = 1:np
mymodel.Structure.Parameters(inp).Minimum = allMyParMins(inp);
% etc. for max, values, ...
end
Then this loop takes ... ages. I have 9 parameters to assign the min, max, free, value, unit and label to and this takes about 12 seconds (!). This is mainly due to the checkDataType and checkDataSize routines in theidParametric.checkStructure method.
So the main question is: why is this so slow? What's the "correct" way to use the new features of assigning min max constraints in idgrey? How do you do this? Is it a bug?

Risposte (1)

Rajiv Singh
Rajiv Singh il 8 Apr 2013
Hi Peter,
Thanks for your inputs. It will indeed be nice to have some optimized functions that modify a models parameterization in an easy/fast way. I will write back once we have a resolution in place.
To avoid the expensive checks, you can extract the "Structure" first into an independent variable:
S = mymodel.Structure;
for inp = 1:np
S.Parameters(inp).Minimum = allMyParMins(inp);
% etc. for max, values, ...
end
mymodel.Structure = S;
Please see if this helps. Also feel free to contact me directly if you have further questions.
Rajiv

Categorie

Scopri di più su Linear Model Identification in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by