Error or mismatch in the specified ODE file when I use the Nonlinear Grey-Box Models

4 views (last 30 days)
Hi, I am trying to estimate parameters in my nonlinear grey box model. The model file was prepared:
function [dx, y] = myode(t, x, u, para, varargin)
where the 'para' was a parameter vector including 15 parameters. Then as needed, I used other variables to represent the parameters:
mtx=zeros(15,15);
for i=1:15
mtx(i,i)= para(i);
........
And then the idnlgrey object was defined. However, when I used 'compare' and 'pem', there was an error:
Error using idnlgrey/isvalid (line 166) Error or mismatch in the specified ODE file "myode". The error message is: "Attempted to access para(2); index out of bounds because numel(para)=1."
But, when I used ode solver to solve the ode with assumed parameters, it did work!
What's the reason and how can I manage it?
Any tips would be much appreciated! Thank you!

Answers (0)

Community Treasure Hunt

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

Start Hunting!