How can i do curve fitting in complex field?

조회 수: 2 (최근 30일)
Jiseung Lee
Jiseung Lee 2020년 8월 21일
댓글: Star Strider 2020년 8월 23일
Now, I trying to make a curve fitting in complex number but, It doesn't work.
below picture is my equation. (x1~x8 is variable(variable is real value, not complex), w is frequency matrix, eq is response)
I want to fit to response result. pls, Give me a solution.

채택된 답변

Star Strider
Star Strider 2020년 8월 21일
편집: Star Strider 2020년 8월 21일
If the ‘x’ parameters are real and ‘w’ is real, and ‘eq’ is complex, one option would be to create your data as separate vectors of the real part and the complex part, then fit the real and complex parts of your model to the real and complex parts of your data.
It would go something like this (assuming column vectors):
Data = [real(eq(:)) imag(eq(:))];
and the model would then be:
eq_mdl = @(x,w) [real(model(x,w)) imag(model(x,w))];
The lsqcurvefit function would be able to fit this sort of problem.
  댓글 수: 2
Jiseung Lee
Jiseung Lee 2020년 8월 23일
Thx. I'm trying to make the code.
In the meantime, I want to ask one more question.
'x6' is real value but, tanh(sqrt(1i*w*x6)/sqrt(1i*w*x6) is complex number
If I use this code('eq_mdl = @(x,w) [real(model(x,w)) imag(model(x,w))];'),
can i get the only one value of 'x6'?
(=can 'x6' satisfy the real part fitting and imag part fitting in same time?)
Star Strider
Star Strider 2020년 8월 23일
I do not understand what you are asking. The code I suggest will evaluate the model for all values of ‘x’ and all values of ‘w’ and create a matrix to compare with the ‘Data’ matrix. The optimisation function you choose will then adjust all the ‘x’ parameters to create the closest fit with the model and the data.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Least Squares에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by