How fit experimental data to mathematical equation with 10 parameters??
조회 수: 2 (최근 30일)
이전 댓글 표시
I have experimental data of a polymer for storage, loss modulus and loss factor.
And I have mathematical equations for storage, loss moudlus and loss factor. These equations contains 10 parameters I need to obtain them by curve fitting. How to obtain these parameters (These parameters also have some constrains) ??
댓글 수: 8
Shivansh
2024년 1월 5일
Hi Anil!
I understand that you are trying to obtain the ten parameters involved in your model of equations using the curve fitting. The code you have attached is not working as all the three equations are producing “NaN” values on the initial parameters.
You can verify it using the following code after the line where you have initialised the upper bounds by “ub”:
testEquation1 = equation1(initialParams, xData);
testEquation2 = equation2(initialParams, xData);
testEquation3 = equation3(initialParams, xData);
if any(isnan(testEquation1))
error('Equation 1 produces NaN at the initial parameters');
end
if any(isnan(testEquation2))
error('Equation 2 produces NaN at the initial parameters');
end
if any(isnan(testEquation3))
error('Equation 3 produces NaN at the initial parameters');
end
The above results clearly indicate that there is some issue with the handling of equations on initial parameters.
You can use a for loop to find the corresponding x values resulting in NaN values for corresponding equations. You can do the same for the first equation by using the following code snippet:
x_resultingToNaN=[];
for i = 1:779
if isnan(testEquation1(i))
x_resultingToNaN(end+1)= xData(i);
end
end
You are currently taking an array of zeros as initial parameters. You can also try experimenting with it and observe any changes.
Hope it helps!
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!