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 个评论
Anil Kumar Mekala
Anil Kumar Mekala 2023-12-26
I am attaching my code which is not working.
You may find the data and equations within that file,
Thank you,
If you find any leads please let me know ASAP.
Shivansh
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 CenterFile Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by