How do I solve for three unknown parameters using only one constraint equation?

2 次查看(过去 30 天)
I need to solve the equation above for the variables ,, and in order to apply a curve fit to adisplacement-loading data, given that I know R and have data for d and P.
I understand that MATLAB has a function called fsolve to solve nonlinear equations like this, but when I run the follow program:
R = 400590;
% Moved d and d0 to right side to set expression = 0:
fun = @(x) x(1).^2/R*((1 + sqrt(1 - Load./x(3)))/2).^(4/3) - 2/3*x(1).^2./R*...
((1 + sqrt(1 - Load./x(3)))/2).^(1/3) + x(2) - Depth; % x(1) = a0, x(2) = d0, x(3) = P_adh
% Allocated an empty array to start algorithm guessing
x0 = zeros(1,3);
x = fsolve(fun,x0);
I get the following errors:
Warning: Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using
Levenberg-Marquardt algorithm instead.
> In fsolve (line 310)
In nanoAnalysis (line 46)
Error using levenbergMarquardt (line 16)
Objective function is returning undefined values at initial point. fsolve cannot continue.
Error in fsolve (line 417)
levenbergMarquardt(funfcn,x,verbosity,options,defaultopt,f,JAC,caller, ...
Error in nanoAnalysis (line 46)
x = fsolve(fun,x0);
I think that the error has something to do with undefined values at initial point, suggesting that I need to guess positive values for the array x0 instead of pre-allocating a zeros array. I would appreciate if somebody could confirm this or suggest a way to non-linearly solve for the three parameters I specified. Thank you for your time.

回答(1 个)

Stephan
Stephan 2019-7-19
编辑:Stephan 2019-7-19
you should rewrite your function as f=d(P) with known constants (R) and use lsqcurvefit using P as xdata and d as ydata.

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by