Determining several unknown variables in an equation using measured data.
조회 수: 9 (최근 30일)
이전 댓글 표시
I am trying to calculate several unknown variable in an equation. I have measured data that is to fit an equation and I want to calculate the unknown variables. The data is measured S-Parameter data (y axis) and frequency (x axis). This data is converted to impedance and graphed with frequency on the x axis and the impedance on the y axis. This data should fit the following equation
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/654360/image.png)
Zd(w) is the measured data. I know f[GHz], w is the converted frequency, I can calculated C, tano is also known and j in the imaginary number. Using this data and the known values I would like to use Matlab to calculate Rc, Rf and Ls.
I have read a number of examples for doing something similar though not the same. I have an average understanding of Matlab but I am no expert and many of the answers I've read assumed a certain level of programming knowledge that I do not have.
I was hoping someone could help get me started in the right direction. I've looked at things like the cftool and optimizer but I'm not knowlegable enough to know how to use them or if that is the correct tool for this case. I've also looked at things like the nonlinear curve fitting tool with no success. Any help would be greatly apprieated.
댓글 수: 0
채택된 답변
Walter Roberson
2021년 6월 16일
Create a function
function goodness = fitparameters(RcRfLs, C, f, tandelta, w, Zd)
Rc = RcRfLs(1); Rf = RcRfLs(2); Ls = RcRfLs(3);
Zd_projected = Rc + Rf and so on
goodness = sum( (Zd_projected - Zd).^2 );
end
Now in the function that sets up all of the input values you can create
%assign to C, f, tandelta, w, Zd before this part
obj = @(RcRfLs) fitparameters(RcRfLs, C, f, tandelta, w, Zd);
Now you can minimize obj using your favorite minimizer, such as fmincon() or fminsearch()
댓글 수: 13
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!