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!