How implement output constraints based on function with parameters from lsqcurvefit?

3 Ansichten (letzte 30 Tage)
I have some circuit that i need to optimize and looks like sin wave. I use lsqcurvefit to optimize my circuit as close to sin wave. This part is actually pretty easy:
[m,N] = size(xdata);
tt=linspace(0,5,N);
yfun=@(t)sin(2*pi*t-pi/2);
yy=yfun(tt);
ratmodel=@(x,tt)sin_sim_function(x);
[xopt,fv,res,ex,out,lambda,Jac]=lsqcurvefit(ratmodel,x0,tt,yy,[0,0,0,0,0],[],opts);
I need to draw someting like sin wav based on x0 after optimaliation but I need in this polt that thd(Total harmonic distortion - so actually a function) that will be less than 1. So in short - after optimazation I need to check that my output meet my constraints based on function - if not try again.
Can you help me with this one?

Antworten (0)

Kategorien

Mehr zu Nonlinear Optimization finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by