## Why does my Nlgreyest freezes when used?

I am trying to identify a nonlinear model with the nlgreyest command. Where the Filename is mij nonlinear model as a function handle. The function handle works perfectly when using the sim or even the step command to check if my function works.

However when the nlgreyest is used with display on, the display freezes, status remains busy, and looks like the figure below.

When I massively mash ctrl+c, I get the following error and nlgreyest seems to load.

I have tried to reduce the number of data points but that doesnt seem to work. I have tried to use different solvers, 15s and 23s because of stiffness. I tried to reduce the number of outputs and measured outputs. I also tried a linear estimation using greyest and a linear model and this does work.

I don’t really what goes wrong here.

Its a 3 Output, 1 Input, 5 State model.

Order = [3,1,5];

Init = struct(‘Name’, {‘Angle’ ‘Angular Velocity’ ‘Current A’ ‘Current B’ ‘Current C’},…

‘Unit’, {‘rad’ ‘rad/s’ ‘A’ ‘A’ ‘A’},…

‘Value’, {0 0 0 0 0},…

‘Minimum’, {-inf -inf -inf -inf -inf},…

‘Maximum’, {inf inf inf inf inf},…

‘Fixed’, {true true true true true});

% AZ 3 Phase

Parameters = struct(‘Name’, {‘Inertia’ ‘Viscous Friction’ ‘Inductance’ ‘Reistance’ ‘Motor Torque Constant’ ‘Motor Omega Constant’ ‘Pole Pairs’},…

‘Unit’, {‘kg/m^2’ ‘kg/m/s’ ‘Henry’ ‘Ohm’ ‘Nm/A’ ‘V/rad/s’ ‘-‘},…

‘Value’, {Jm Bm La Ra Kt Kv PolePairs},…

‘Minimum’, {1e-6 1e-5 1e-5 1e-2 1e-2 1e-2 -inf},…

‘Maximum’, {1e-3 1e-2 1e-2 1e1 1e1 1e1 inf},…

‘Fixed’, {false false false false false false true});

optnl = nlgreyestOptions;

optnl.Display = ‘on’;

optnl.SearchMethod = ‘lm’;

nlgr = idnlgrey(FileName, Order, Parameters, Init,0);

datar = iddata(y, u, dt);

nlgr = nlgreyest(datar, nlgr, optnl);I am trying to identify a nonlinear model with the nlgreyest command. Where the Filename is mij nonlinear model as a function handle. The function handle works perfectly when using the sim or even the step command to check if my function works.

However when the nlgreyest is used with display on, the display freezes, status remains busy, and looks like the figure below.

When I massively mash ctrl+c, I get the following error and nlgreyest seems to load.

I have tried to reduce the number of data points but that doesnt seem to work. I have tried to use different solvers, 15s and 23s because of stiffness. I tried to reduce the number of outputs and measured outputs. I also tried a linear estimation using greyest and a linear model and this does work.

I don’t really what goes wrong here.

Its a 3 Output, 1 Input, 5 State model.

Order = [3,1,5];

Init = struct(‘Name’, {‘Angle’ ‘Angular Velocity’ ‘Current A’ ‘Current B’ ‘Current C’},…

‘Unit’, {‘rad’ ‘rad/s’ ‘A’ ‘A’ ‘A’},…

‘Value’, {0 0 0 0 0},…

‘Minimum’, {-inf -inf -inf -inf -inf},…

‘Maximum’, {inf inf inf inf inf},…

‘Fixed’, {true true true true true});

% AZ 3 Phase

Parameters = struct(‘Name’, {‘Inertia’ ‘Viscous Friction’ ‘Inductance’ ‘Reistance’ ‘Motor Torque Constant’ ‘Motor Omega Constant’ ‘Pole Pairs’},…

‘Unit’, {‘kg/m^2’ ‘kg/m/s’ ‘Henry’ ‘Ohm’ ‘Nm/A’ ‘V/rad/s’ ‘-‘},…

‘Value’, {Jm Bm La Ra Kt Kv PolePairs},…

‘Minimum’, {1e-6 1e-5 1e-5 1e-2 1e-2 1e-2 -inf},…

‘Maximum’, {1e-3 1e-2 1e-2 1e1 1e1 1e1 inf},…

‘Fixed’, {false false false false false false true});

optnl = nlgreyestOptions;

optnl.Display = ‘on’;

optnl.SearchMethod = ‘lm’;

nlgr = idnlgrey(FileName, Order, Parameters, Init,0);

datar = iddata(y, u, dt);

nlgr = nlgreyest(datar, nlgr, optnl); I am trying to identify a nonlinear model with the nlgreyest command. Where the Filename is mij nonlinear model as a function handle. The function handle works perfectly when using the sim or even the step command to check if my function works.

However when the nlgreyest is used with display on, the display freezes, status remains busy, and looks like the figure below.

When I massively mash ctrl+c, I get the following error and nlgreyest seems to load.

I have tried to reduce the number of data points but that doesnt seem to work. I have tried to use different solvers, 15s and 23s because of stiffness. I tried to reduce the number of outputs and measured outputs. I also tried a linear estimation using greyest and a linear model and this does work.

I don’t really what goes wrong here.

Its a 3 Output, 1 Input, 5 State model.

Order = [3,1,5];

Init = struct(‘Name’, {‘Angle’ ‘Angular Velocity’ ‘Current A’ ‘Current B’ ‘Current C’},…

‘Unit’, {‘rad’ ‘rad/s’ ‘A’ ‘A’ ‘A’},…

‘Value’, {0 0 0 0 0},…

‘Minimum’, {-inf -inf -inf -inf -inf},…

‘Maximum’, {inf inf inf inf inf},…

‘Fixed’, {true true true true true});

% AZ 3 Phase

Parameters = struct(‘Name’, {‘Inertia’ ‘Viscous Friction’ ‘Inductance’ ‘Reistance’ ‘Motor Torque Constant’ ‘Motor Omega Constant’ ‘Pole Pairs’},…

‘Unit’, {‘kg/m^2’ ‘kg/m/s’ ‘Henry’ ‘Ohm’ ‘Nm/A’ ‘V/rad/s’ ‘-‘},…

‘Value’, {Jm Bm La Ra Kt Kv PolePairs},…

‘Minimum’, {1e-6 1e-5 1e-5 1e-2 1e-2 1e-2 -inf},…

‘Maximum’, {1e-3 1e-2 1e-2 1e1 1e1 1e1 inf},…

‘Fixed’, {false false false false false false true});

optnl = nlgreyestOptions;

optnl.Display = ‘on’;

optnl.SearchMethod = ‘lm’;

nlgr = idnlgrey(FileName, Order, Parameters, Init,0);

datar = iddata(y, u, dt);

nlgr = nlgreyest(datar, nlgr, optnl); nlgreyest, idnlgrey, iddata, identification, nonlinear, system identification MATLAB Answers — New Questions