i do not understand why don`t you rewritten the equations Y=a*(U-b)^2 just to the form Y=a*U.^2-2*a*b*U+a*b*b. then you can calculate the a, b from these three terms. and then use polyfit .Although 3 eqs 2 parameters, leads to overdetermined problem, if the deviations are not so big, it will be in tolerance.
definitely you can also write a m-function (or for state space s-function) with LSQ or RLS algorithm. there are lots of papers about that in internet. and not so complicated. for estimate the parameter of a transfer function you can also use toolbox Ident. just enter ident in the command line, you will see it.
but anyway parameter estimation or curve fitting are really boring and chanllenging work. it needs time to get good at it.
[ Last edited by ASDF on 2005-12-8 at 16:14 ]作者: ASDF 时间: 2005-12-8 15:10
the function in matlab is ....polyfit.....
the general idea of LSQ is just based on the form
Y=phi*theta
Y and phi are the measurement matrix
theta is the parameters matrix
start from a initial value of theta, we get
Y_head=phi(t_0)*theta(t_0)
minimize the deviation Error=Y-Y_head, we get the estimated theta(t_1) for the next time step,, and so on. so generally you should rewrite the equations in the form of Y_head=phi(t_0)*theta(t_0), firstly . even for the ODE or PDE equations, you should also discretize them as the first step of the estimation process.作者: jiejiedog 时间: 2005-12-9 08:47