Problem with fzero()?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
clc
clear all
close all
CStrain = 0.001536;
eps_i = 0.00192;
f_i = 377.76;
fy = 425;
Es = 200000;
eps_y = fy/Es;
PointTB = [eps_i, f_i];
eps_n = 0.0018777;
eps_p = (PointTB(1) - eps_n)/eps_n;
Kp = eps_p/eps_n;
A = 1.9*(Kp)^(-0.1);
R = 10*(Kp)^(-0.2);
% xfun = @(x) x^2 + 2*x - 4;
% x = fzero(xfun,1)
xfun = @(x) (CStrain - eps_i) - ((x - fy)/Es)*(1 + (A^(-R))*((x - f_i)/fy)^(R-1));
x = fzero(xfun,1)
In the above mentioned code, I do not know the initial guess in fzero() function, hence I gave as "1", but the program is returning a error, as shown below
Error using fzero (line 309)
Function value at starting guess must be finite
and real.
Error in Rough (line 27)
x = fzero(xfun,1)
Could anyone please help me how to solve the problem and get the value of "x".
Thanks in advance...
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Optimization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!