Optimizing coefficients of an asymptotic series using lsqnonlin.

조회 수: 1 (최근 30일)
waqas
waqas 2019년 9월 3일
편집: waqas 2019년 9월 18일
Hi,
I am trying to find the coefficients of an asymtotic series using experimental and simulation data with lsqnonlin but the results are not making any sense. I never used lsqnonlin before. I am not sure about what should be put as initial guess as I never worked with optimization problems before but from the literature, value of coefs(5) should be around 150. (displacements need to be divided by 1000 to make the units similar). Any suggestions regarding how to approach the problem? I have attached the relevant mat file along with the code.
unew = fillmissing(uselected_data,'movmedian',50); %to fill NaN values
vnew = fillmissing(vselected_data,'movmedian',50); %to fill NaN values
uv = unew +i*vnew;
options = optimoptions('lsqnonlin','Display','iter');
x00 = rand(9,1); %unknown coefficients of asymptotic series.
fun = @(x) (uv - (omega + i*gamma)*x) %Omega and Gamma are the values with
coefs = lsqnonlin(fun,x00,[],[],options)
  댓글 수: 2
Matt J
Matt J 2019년 9월 3일
편집: Matt J 2019년 9월 3일
Note that using lsqnonlin with complex-valued objectives is illegal for the most part, except under special conditions mentioned here,
waqas
waqas 2019년 9월 3일
Thanks for the input. I realized that too and did not follow up on the technique because firstly, the initial guesses were totally random since I had no idea what should be the potential value for them and I read a comment from you on another question that it is likely to give wrong results so am trying to get intermediate results for now and then use lsqnonlin without complex form to find the parameters later.

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2019년 9월 3일
The problem looks very linear to me. I would just do,
coefs=(omega + i*gamma)\uv
  댓글 수: 1
waqas
waqas 2019년 9월 18일
편집: waqas 2019년 9월 18일
Hi,
I have rectified the problem statement, there was another approach also used where we take the absolute, and to my understanding, it can be solved using optimization. Following is the description of the what I am currently trying to implement:
where I have the u vector as well as Ω and Γ and would like to find the coefficients ω and υ for n = [-1:3] in this case. Problem that I am having with lsqnonlin is that I am not sure about the initial values of these coefficients and am getting following error:
"Objective function is returning undefined values at initial point. lsqnonlin cannot continue."
Following is the code that I wrote for lsqnonlin (.mat file is also attached.):
npower = -1:1:3;
x00 = ones(length(npower),2);
fun = @(x) (uv - (omega*x(:,1) + gamma*x(:,2)))
options = optimoptions('lsqnonlin','Display','iter');
coefs = lsqnonlin(fun,x00,[],[],options)
computedvsExperi = (uv - (omega*coefs(:,1) + gamma*coefs(:,2)));
I know the initial values are very important but for the current case I have no idea about those as they are coefficients of an assmptotic series which can give displacements.(Discussion on same error.)Any suggestions regarding how to tackle this issue?
Cheers,

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by