You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
error using fzero in line 6
20 views (last 30 days)
Show older comments
function hw7
close all
fun = @(e) hw7fun(e);
e0 = 0.05:0.025:1.25;
options = optimset('Display', 'iter');
[e, residual, exitflag, output] = fzero(fun, e0, options);
fprintf('exitflag %d residual %6.3e x %6.3f\n', exitflag, residual, e);
endu
function f = hw7fun(e)
dp=416;
L=1.5;
h=1e-3;
v=0.1;
d=5e-2;
p=2e3;
f = (dp/L)-150*((h*v)/d^2)*((1-e)^2/e^3)-(7/4)*((p*v^2)/d)*((1-e)/e^3);
endoutput.funcCount
end
%I cant figure out why there is an error
Accepted Answer
Star Strider
on 11 Jun 2021
Try something like this —
hw7 % Call Function
function hw7
fun = @(e) hw7fun(e);
% e0 = 0.05:0.025:1.25;
e0 = [0.05 1.25];
options = optimset('Display', 'iter');
[e, residual, exitflag, output] = fzero(fun, e0, options);
fprintf('exitflag %d residual %6.3e x %6.3f\n', exitflag, residual, e);
function f = hw7fun(e)
dp=416;
L=1.5;
h=1e-3;
v=0.1;
d=5e-2;
p=2e3;
f = (dp/L)-150*((h*v)/d^2)*((1-e)^2/e^3)-(7/4)*((p*v^2)/d)*((1-e)/e^3);
% endoutput.funcCount
end
end
.
2 Comments
Nathaniel Asefa
on 11 Jun 2021
i need it spaced by 0.025 is there any way I can keep it that way
Star Strider
on 11 Jun 2021
Yes. Use a loop —
hw7 % Call Function
Search for an interval around 0.05 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.05 -5.36304e+06 0.05 -5.36304e+06 initial interval
3 0.0485858 -5.85392e+06 0.0514142 -4.92513e+06 search
5 0.048 -6.07465e+06 0.052 -4.75758e+06 search
7 0.0471716 -6.40598e+06 0.0528284 -4.53324e+06 search
9 0.046 -6.9166e+06 0.054 -4.23923e+06 search
11 0.0443431 -7.73478e+06 0.0556569 -3.86493e+06 search
13 0.042 -9.12545e+06 0.058 -3.40661e+06 search
15 0.0386863 -1.17178e+07 0.0613137 -2.87332e+06 search
17 0.034 -1.73465e+07 0.066 -2.29205e+06 search
19 0.0273726 -3.34734e+07 0.0726274 -1.70773e+06 search
21 0.018 -1.18859e+08 0.082 -1.17436e+06 search
23 0.00474517 -6.57608e+09 0.0952548 -738168 search
24 -0.014 2.60922e+08 0.0952548 -738168 search
Search for a zero in the interval [-0.014, 0.0952548]:
Func-count x f(x) Procedure
24 0.0952548 -738168 initial
25 0.0949466 -745639 interpolation
26 0.0404733 -1.0214e+07 bisection
27 -0.014 2.60922e+08 bisection
28 0.0132367 -3.00354e+08 interpolation
29 0.0132218 -3.01371e+08 interpolation
30 0.0059417 -3.34551e+09 bisection
31 0.00230164 -5.77676e+10 bisection
32 -0.00133842 2.94856e+11 bisection
33 -0.00125726 3.55696e+11 interpolation
34 0.000481607 -6.31707e+12 bisection
35 -0.000387827 1.21077e+13 interpolation
36 -0.000333065 1.91146e+13 interpolation
37 0.000183514 -1.14213e+14 bisection
38 0.000167152 -1.51145e+14 interpolation
39 -7.47752e-05 1.68875e+15 bisection
40 -5.17014e-05 5.1088e+15 interpolation
41 4.61885e-05 -7.16446e+15 bisection
42 4.61781e-05 -7.1693e+15 interpolation
43 2.17108e-05 -6.89871e+16 bisection
44 9.47716e-06 -8.29404e+17 bisection
45 3.36034e-06 -1.8606e+19 bisection
46 -2.75648e-06 3.37086e+19 bisection
47 -2.75247e-06 3.38563e+19 interpolation
48 -1.22527e-06 3.83805e+20 bisection
49 -4.61671e-07 7.17477e+21 bisection
50 3.01929e-07 -2.56503e+22 bisection
51 2.94989e-07 -2.75034e+22 interpolation
52 1.07559e-07 -5.67367e+23 bisection
53 -7.9871e-08 1.3856e+24 bisection
54 -7.93856e-08 1.41117e+24 interpolation
55 -3.27708e-08 2.00606e+25 bisection
56 1.3844e-08 -2.66086e+26 bisection
57 -9.46341e-09 8.33032e+26 interpolation
58 8.20148e-09 -1.27976e+27 interpolation
59 7.90729e-09 -1.42798e+27 interpolation
60 2.7044e-09 -3.56936e+28 bisection
61 -2.49848e-09 4.52663e+28 bisection
62 -2.4983e-09 4.52762e+28 interpolation
63 -1.19767e-09 4.10953e+29 bisection
64 -5.47355e-10 4.30523e+30 bisection
65 -2.22198e-10 6.43557e+31 bisection
66 1.0296e-10 -6.4684e+32 bisection
67 7.65273e-11 -1.57527e+33 interpolation
68 -5.96187e-11 3.33163e+33 bisection
69 -5.94251e-11 3.3643e+33 interpolation
70 -2.54854e-11 4.2651e+34 bisection
71 -8.51555e-12 1.14332e+36 bisection
72 8.45431e-12 -1.16834e+36 bisection
73 8.45386e-12 -1.16853e+36 interpolation
74 4.21162e-12 -9.45056e+36 bisection
75 2.0905e-12 -7.7278e+37 bisection
76 1.02994e-12 -6.46209e+38 bisection
77 4.99656e-13 -5.65967e+39 bisection
78 2.34516e-13 -5.47378e+40 bisection
79 1.01946e-13 -6.66338e+41 bisection
80 3.56609e-14 -1.55678e+43 bisection
81 -3.06242e-14 2.45817e+43 bisection
82 -3.01801e-14 2.56829e+43 interpolation
83 -1.38308e-14 2.66845e+44 bisection
84 -5.65624e-15 3.90141e+45 bisection
85 2.51837e-15 -4.42023e+46 bisection
86 1.72251e-15 -1.38141e+47 interpolation
87 -1.56893e-15 1.82807e+47 bisection
88 -1.12484e-15 4.96054e+47 interpolation
89 -5.24028e-16 4.90616e+48 bisection
Current point x may be near a singular point. The interval [-0.014, 0.0952548]
reduced to the requested tolerance and the function changes sign in the interval,
but f(x) increased in magnitude as the interval reduced.
exitflag -5 residual 4.906e+48 x -0.000
Search for an interval around 0.075 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.075 -1.54671e+06 0.075 -1.54671e+06 initial interval
3 0.0728787 -1.68966e+06 0.0771213 -1.41924e+06 search
5 0.072 -1.75396e+06 0.078 -1.37049e+06 search
7 0.0707574 -1.85052e+06 0.0792426 -1.30523e+06 search
9 0.069 -1.99937e+06 0.081 -1.21974e+06 search
11 0.0665147 -2.238e+06 0.0834853 -1.11096e+06 search
13 0.063 -2.6439e+06 0.087 -977852 search
15 0.0580294 -3.40132e+06 0.0919706 -823137 search
17 0.051 -5.04834e+06 0.099 -654748 search
19 0.0410589 -9.77714e+06 0.108941 -485831 search
21 0.027 -3.48918e+07 0.123 -332103 search
23 0.00711775 -1.94378e+09 0.142882 -206919 search
24 -0.021 7.78487e+07 0.142882 -206919 search
Search for a zero in the interval [-0.021, 0.142882]:
Func-count x f(x) Procedure
24 0.142882 -206919 initial
25 0.142448 -208928 interpolation
26 0.0607239 -2.95974e+06 bisection
27 -0.021 7.78487e+07 bisection
28 0.019862 -8.82981e+07 interpolation
29 0.0198447 -8.85303e+07 interpolation
30 0.00899536 -9.61151e+08 bisection
31 0.00357069 -1.54519e+10 bisection
32 -0.00185398 1.10995e+11 bisection
33 -0.00160849 1.69923e+11 interpolation
34 0.000858358 -1.11538e+12 bisection
35 0.000763486 -1.58514e+12 interpolation
36 -0.000375067 1.33857e+13 bisection
37 -0.000305634 2.47362e+13 interpolation
38 0.000194209 -9.63626e+13 bisection
39 0.000188447 -1.05476e+14 interpolation
40 6.63673e-05 -2.41498e+15 bisection
41 -5.57123e-05 4.08296e+15 bisection
42 -5.5659e-05 4.09471e+15 interpolation
43 -2.51658e-05 4.42982e+16 bisection
44 -9.91913e-06 7.23417e+17 bisection
45 5.3275e-06 -4.66909e+18 bisection
46 4.76263e-06 -6.53525e+18 interpolation
47 -2.29581e-06 5.83439e+19 bisection
48 -1.82203e-06 1.16719e+20 interpolation
49 1.23341e-06 -3.76257e+20 bisection
50 1.21293e-06 -3.95637e+20 interpolation
51 4.5931e-07 -7.28594e+21 bisection
52 -2.9431e-07 2.76944e+22 bisection
53 -2.86188e-07 3.01196e+22 interpolation
54 -1.01844e-07 6.68341e+23 bisection
55 8.25004e-08 -1.25729e+24 bisection
56 8.23522e-08 -1.2641e+24 interpolation
57 3.63402e-08 -1.4711e+25 bisection
58 1.33342e-08 -2.97786e+26 bisection
59 -9.67179e-09 7.80341e+26 bisection
60 -9.59424e-09 7.99416e+26 interpolation
61 -3.88152e-09 1.20726e+28 bisection
62 1.8312e-09 -1.14973e+29 bisection
63 1.40485e-09 -2.54632e+29 interpolation
64 -1.02516e-09 6.5529e+29 bisection
65 -1.01749e-09 6.70217e+29 interpolation
66 -4.13821e-10 9.96249e+30 bisection
67 1.89848e-10 -1.03179e+32 bisection
68 1.38446e-10 -2.66049e+32 interpolation
69 -1.11987e-10 5.02697e+32 bisection
70 -1.1178e-10 5.05483e+32 interpolation
71 -4.92753e-11 5.90087e+33 bisection
72 -1.80228e-11 1.20598e+35 bisection
73 1.32298e-11 -3.04889e+35 bisection
74 1.31375e-11 -3.11363e+35 interpolation
75 5.37052e-12 -4.55781e+36 bisection
76 -2.39646e-12 5.12971e+37 bisection
77 -1.64756e-12 1.57863e+38 interpolation
78 1.48703e-12 -2.14708e+38 bisection
79 1.48658e-12 -2.149e+38 interpolation
80 7.03159e-13 -2.03069e+39 bisection
81 3.11446e-13 -2.33698e+40 bisection
82 1.1559e-13 -4.57132e+41 bisection
83 -8.0266e-14 1.36524e+42 bisection
84 -7.92336e-14 1.41931e+42 interpolation
85 -3.07858e-14 2.41967e+43 bisection
86 1.76621e-14 -1.28138e+44 bisection
87 1.64805e-14 -1.57722e+44 interpolation
88 -6.56182e-15 2.4988e+45 bisection
89 4.95935e-15 -5.78804e+45 interpolation
90 3.39478e-15 -1.80456e+46 interpolation
91 -3.08774e-15 2.39817e+46 bisection
92 -2.64366e-15 3.82111e+46 interpolation
93 -1.24507e-15 3.65783e+47 bisection
94 -5.45777e-16 4.34269e+48 bisection
Current point x may be near a singular point. The interval [-0.021, 0.142882]
reduced to the requested tolerance and the function changes sign in the interval,
but f(x) increased in magnitude as the interval reduced.
exitflag -5 residual 4.343e+48 x -0.000
Search for an interval around 0.1 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.1 -634583 0.1 -634583 initial interval
3 0.0971716 -693841 0.102828 -581774 search
5 0.096 -720506 0.104 -561583 search
7 0.0943431 -760555 0.105657 -534565 search
9 0.092 -822320 0.108 -499181 search
11 0.0886863 -921393 0.111314 -454183 search
13 0.084 -1.09004e+06 0.116 -399166 search
15 0.0773726 -1.40507e+06 0.122627 -335285 search
17 0.068 -2.09115e+06 0.132 -265866 search
19 0.0547452 -4.06522e+06 0.145255 -196381 search
21 0.036 -1.45825e+07 0.164 -133343 search
23 0.00949033 -8.18058e+08 0.19051 -82243.1 search
24 -0.028 3.30697e+07 0.19051 -82243.1 search
Search for a zero in the interval [-0.028, 0.19051]:
Func-count x f(x) Procedure
24 0.19051 -82243.1 initial
25 0.189968 -83007.7 interpolation
26 0.0809838 -1.22049e+06 bisection
27 -0.028 3.30697e+07 bisection
28 0.0264919 -3.69576e+07 interpolation
29 0.0264744 -3.70316e+07 interpolation
30 0.0121038 -3.9328e+08 bisection
31 0.00491855 -5.90382e+09 bisection
32 -0.00226673 6.07568e+10 bisection
33 -0.00166579 1.52992e+11 interpolation
34 0.00132591 -3.0247e+11 bisection
35 0.00132277 -3.04629e+11 interpolation
36 0.000576415 -3.68423e+12 bisection
37 0.000203236 -8.40837e+13 bisection
38 -0.000169942 1.43872e+14 bisection
39 -0.000169767 1.44318e+14 interpolation
40 -7.65599e-05 1.57338e+15 bisection
41 -2.99564e-05 2.62633e+16 bisection
42 1.66471e-05 -1.53032e+17 bisection
43 1.5248e-05 -1.99141e+17 interpolation
44 -6.65466e-06 2.39569e+18 bisection
45 -4.33208e-06 8.68395e+18 interpolation
46 4.29666e-06 -8.90038e+18 bisection
47 4.29666e-06 -8.90038e+18 interpolation
48 2.13948e-06 -7.20908e+19 bisection
49 1.06089e-06 -5.91287e+20 bisection
50 5.21589e-07 -4.97529e+21 bisection
51 2.51941e-07 -4.41476e+22 bisection
52 1.17117e-07 -4.39485e+23 bisection
53 4.9705e-08 -5.74915e+24 bisection
54 -1.7707e-08 1.27165e+26 bisection
55 1.5999e-08 -1.72396e+26 interpolation
56 1.58148e-08 -1.78489e+26 interpolation
57 6.20809e-09 -2.95075e+27 bisection
58 -3.39865e-09 1.7984e+28 bisection
59 -3.08186e-09 2.41193e+28 interpolation
60 1.40472e-09 -2.54705e+29 bisection
61 1.01119e-09 -6.8281e+29 interpolation
62 -8.38572e-10 1.19725e+30 bisection
63 -8.37565e-10 1.20157e+30 interpolation
64 -3.75627e-10 1.33209e+31 bisection
65 -1.44658e-10 2.33227e+32 bisection
66 8.63113e-11 -1.098e+33 bisection
67 8.20177e-11 -1.27962e+33 interpolation
68 -2.91732e-11 2.84349e+34 bisection
69 2.64222e-11 -3.82733e+34 interpolation
70 2.61409e-11 -3.95223e+34 interpolation
71 1.03328e-11 -6.39951e+35 bisection
72 -5.47525e-12 4.30123e+36 bisection
73 -4.84071e-12 6.22413e+36 interpolation
74 2.42879e-12 -4.9276e+37 bisection
75 2.03237e-12 -8.40995e+37 interpolation
76 -1.20596e-12 4.02538e+38 bisection
77 -1.14334e-12 4.7236e+38 interpolation
78 4.13208e-13 -1.00069e+40 bisection
79 -3.65068e-13 1.45105e+40 interpolation
80 -3.56955e-13 1.55226e+40 interpolation
81 -1.30702e-13 3.16197e+41 bisection
82 9.55508e-14 -8.09285e+41 bisection
83 9.48511e-14 -8.27327e+41 interpolation
84 3.86378e-14 -1.22397e+43 bisection
85 -1.75756e-14 1.30039e+44 bisection
86 -1.25997e-14 3.5296e+44 interpolation
87 1.05311e-14 -6.04488e+44 bisection
88 1.0087e-14 -6.87894e+44 interpolation
89 4.52633e-15 -7.61316e+45 bisection
90 1.74601e-15 -1.32636e+47 bisection
91 -1.03431e-15 6.38049e+47 bisection
92 -5.9022e-16 3.43371e+48 interpolation
93 3.55852e-16 -1.56674e+49 bisection
Current point x may be near a singular point. The interval [-0.028, 0.19051]
reduced to the requested tolerance and the function changes sign in the interval,
but f(x) increased in magnitude as the interval reduced.
exitflag -5 residual -1.567e+49 x 0.000
Search for an interval around 0.125 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.125 -315675 0.125 -315675 initial interval
3 0.121464 -345477 0.128536 -289130 search
5 0.12 -358893 0.13 -278986 search
7 0.117929 -379048 0.132071 -265414 search
9 0.115 -410144 0.135 -247648 search
11 0.110858 -460050 0.139142 -225067 search
13 0.105 -545069 0.145 -197479 search
15 0.0967157 -704060 0.153284 -165484 search
17 0.085 -1.05085e+06 0.165 -130771 search
19 0.0684315 -2.05088e+06 0.181569 -96104.4 search
21 0.045 -7.39585e+06 0.205 -64758.5 search
23 0.0118629 -4.17834e+08 0.238137 -39471.2 search
24 -0.035 1.70481e+07 0.238137 -39471.2 search
Search for a zero in the interval [-0.035, 0.238137]:
Func-count x f(x) Procedure
24 0.238137 -39471.2 initial
25 0.237506 -39822.2 interpolation
26 0.101253 -610445 bisection
27 -0.035 1.70481e+07 bisection
28 0.0331265 -1.87723e+07 interpolation
29 0.0331104 -1.88002e+07 interpolation
30 0.015267 -1.95345e+08 bisection
31 0.00634536 -2.74567e+09 bisection
32 -0.0025763 4.13943e+10 bisection
33 0.00188453 -1.05286e+11 interpolation
34 -0.00131742 3.09176e+11 interpolation
35 0.00107114 -5.73854e+11 bisection
36 0.00106933 -5.76773e+11 interpolation
37 0.000473092 -6.66441e+12 bisection
38 0.000174974 -1.31767e+14 bisection
39 -0.000123143 3.78118e+14 bisection
40 -0.000121766 3.91088e+14 interpolation
41 -4.79255e-05 6.41396e+15 bisection
42 2.59155e-05 -4.05615e+16 bisection
43 2.32895e-05 -5.58873e+16 interpolation
44 -1.1005e-05 5.29715e+17 bisection
45 -8.46517e-06 1.16386e+18 interpolation
46 6.14227e-06 -3.0466e+18 bisection
47 6.09322e-06 -3.12077e+18 interpolation
48 2.46588e-06 -4.70854e+19 bisection
49 -1.16145e-06 4.5061e+20 bisection
50 -8.88604e-07 1.00619e+21 interpolation
51 6.52215e-07 -2.54467e+21 bisection
52 6.47658e-07 -2.59877e+21 interpolation
53 2.64732e-07 -3.80528e+22 bisection
54 -1.18194e-07 4.27579e+23 bisection
55 -8.13595e-08 1.31093e+24 interpolation
56 7.32687e-08 -1.79493e+24 bisection
57 7.32557e-08 -1.79589e+24 interpolation
58 3.46052e-08 -1.70366e+25 bisection
59 1.52799e-08 -1.979e+26 bisection
60 5.61724e-09 -3.98323e+27 bisection
61 -4.0454e-09 1.0664e+28 bisection
62 -4.01023e-09 1.0947e+28 interpolation
63 -1.61216e-09 1.68493e+29 bisection
64 7.85919e-10 -1.45436e+30 bisection
65 6.33854e-10 -2.77228e+30 interpolation
66 -4.13119e-10 1.00133e+31 bisection
67 -4.03324e-10 1.07607e+31 interpolation
68 -1.46478e-10 2.24638e+32 bisection
69 1.10367e-10 -5.25147e+32 bisection
70 1.09808e-10 -5.3322e+32 interpolation
71 4.58761e-11 -7.31216e+33 bisection
72 -1.80555e-11 1.19944e+35 bisection
73 1.39103e-11 -2.62298e+35 interpolation
74 1.0377e-11 -6.31809e+35 interpolation
75 -8.02493e-12 1.3661e+36 bisection
76 -7.99606e-12 1.38095e+36 interpolation
77 -3.41e-12 1.78049e+37 bisection
78 1.17605e-12 -4.34037e+38 bisection
79 -1.11698e-12 5.06608e+38 interpolation
80 -1.11552e-12 5.08591e+38 interpolation
81 -4.98767e-13 5.68999e+39 bisection
82 -1.90389e-13 1.02301e+41 bisection
83 1.17989e-13 -4.29809e+41 bisection
84 1.13662e-13 -4.80799e+41 interpolation
85 3.87309e-14 -1.21515e+43 bisection
86 -3.61997e-14 1.4883e+43 bisection
87 -3.57556e-14 1.54445e+43 interpolation
88 -1.7245e-14 1.37663e+44 bisection
89 -7.98967e-15 1.38426e+45 bisection
90 -3.36201e-15 1.85783e+46 bisection
91 1.26564e-15 -3.48237e+47 bisection
92 -1.04819e-15 6.13039e+47 interpolation
93 -6.04098e-16 3.20245e+48 interpolation
94 4.2742e-16 -9.04148e+48 bisection
Current point x may be near a singular point. The interval [-0.035, 0.238137]
reduced to the requested tolerance and the function changes sign in the interval,
but f(x) increased in magnitude as the interval reduced.
exitflag -5 residual -9.041e+48 x 0.000
Search for an interval around 0.15 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.15 -177303 0.15 -177303 initial interval
3 0.145757 -194239 0.154243 -162228 search
5 0.144 -201866 0.156 -156469 search
7 0.141515 -213327 0.158485 -148767 search
9 0.138 -231017 0.162 -138688 search
11 0.133029 -259424 0.166971 -125885 search
13 0.126 -307856 0.174 -110256 search
15 0.116059 -398531 0.183941 -92152.1 search
17 0.102 -596626 0.198 -72542.9 search
19 0.0821177 -1.16916e+06 0.217882 -53007.8 search
21 0.054 -4.23923e+06 0.246 -35405.7 search
23 0.0142355 -2.41216e+08 0.285765 -21278.5 search
24 -0.042 9.93326e+06 0.285765 -21278.5 search
Search for a zero in the interval [-0.042, 0.285765]:
Func-count x f(x) Procedure
24 0.285765 -21278.5 initial
25 0.285064 -21459.3 interpolation
26 0.121532 -344875 bisection
27 -0.042 9.93326e+06 bisection
28 0.039766 -1.07768e+07 interpolation
29 0.039752 -1.07883e+07 interpolation
30 0.0184849 -1.09693e+08 bisection
31 0.00785137 -1.44716e+09 bisection
32 -0.00278219 3.28747e+10 bisection
33 0.00253459 -4.32484e+10 interpolation
34 0.0025135 -4.43473e+10 interpolation
35 0.00101371 -6.77041e+11 bisection
36 -0.000486071 6.15062e+12 bisection
37 -0.00038263 1.26077e+13 interpolation
38 0.000263821 -3.84379e+13 bisection
39 0.000260174 -4.00773e+13 interpolation
40 0.000100385 -6.97839e+14 bisection
41 -5.94042e-05 3.36806e+15 bisection
42 -5.62544e-05 3.96606e+15 interpolation
43 2.04904e-05 -8.20629e+16 bisection
44 -1.7882e-05 1.2347e+17 interpolation
45 -1.73382e-05 1.35456e+17 interpolation
46 -6.08437e-06 3.13444e+18 bisection
47 5.16949e-06 -5.11046e+18 bisection
48 5.16559e-06 -5.12203e+18 interpolation
49 2.35408e-06 -5.41181e+19 bisection
50 9.48317e-07 -8.27835e+20 bisection
51 -4.57441e-07 7.37563e+21 bisection
52 -3.634e-07 1.47113e+22 interpolation
53 2.45438e-07 -4.77507e+22 bisection
54 2.41271e-07 -5.02676e+22 interpolation
55 9.11452e-08 -9.32402e+23 bisection
56 -5.89808e-08 3.4409e+24 bisection
57 -5.74893e-08 3.71572e+24 interpolation
58 -2.07036e-08 7.95552e+25 bisection
59 1.60822e-08 -1.69734e+26 bisection
60 1.60278e-08 -1.71468e+26 interpolation
61 6.85855e-09 -2.1883e+27 bisection
62 -2.31069e-09 5.7224e+28 bisection
63 2.27393e-09 -6.00446e+28 interpolation
64 2.27385e-09 -6.00509e+28 interpolation
65 1.10017e-09 -5.30189e+29 bisection
66 5.13323e-10 -5.21953e+30 bisection
67 2.19902e-10 -6.63919e+31 bisection
68 -7.35187e-11 1.77669e+33 bisection
69 7.31919e-11 -1.8006e+33 interpolation
70 7.31914e-11 -1.80063e+33 interpolation
71 3.62689e-11 -1.4798e+34 bisection
72 1.78076e-11 -1.25022e+35 bisection
73 8.577e-12 -1.11892e+36 bisection
74 3.96168e-12 -1.13544e+37 bisection
75 1.65402e-12 -1.5602e+38 bisection
76 -6.53634e-13 2.52814e+39 bisection
77 5.00195e-13 -5.64139e+39 interpolation
78 3.62769e-13 -1.47881e+40 interpolation
79 -2.9657e-13 2.70661e+40 bisection
80 -2.96112e-13 2.71918e+40 interpolation
81 -1.31506e-13 3.10433e+41 bisection
82 -4.92031e-14 5.92688e+42 bisection
83 3.30998e-14 -1.94684e+43 bisection
84 3.25158e-14 -2.05362e+43 interpolation
85 1.22321e-14 -3.85748e+44 bisection
86 -8.05168e-15 1.35252e+45 bisection
87 -7.60759e-15 1.60348e+45 interpolation
88 -2.7587e-15 3.36274e+46 bisection
89 2.0902e-15 -7.73109e+46 bisection
90 1.64611e-15 -1.5828e+47 interpolation
91 6.55932e-16 -2.50166e+48 bisection
92 -3.34247e-16 1.8906e+49 bisection
Current point x may be near a singular point. The interval [-0.042, 0.285765]
reduced to the requested tolerance and the function changes sign in the interval,
but f(x) increased in magnitude as the interval reduced.
exitflag -5 residual 1.891e+49 x -0.000
Search for an interval around 0.175 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.175 -108240 0.175 -108240 initial interval
3 0.17005 -118709 0.17995 -98926.1 search
5 0.168 -123426 0.182 -95369.7 search
7 0.165101 -130515 0.184899 -90614.7 search
9 0.161 -141463 0.189 -84395.1 search
11 0.155201 -159054 0.194799 -76499.3 search
13 0.147 -189070 0.203 -66869.4 search
15 0.135402 -245331 0.214598 -55727.7 search
17 0.119 -368446 0.231 -43681 search
19 0.095804 -725097 0.254196 -31710.5 search
21 0.063 -2.6439e+06 0.287 -20964.3 search
23 0.0166081 -1.51534e+08 0.333392 -12386.9 search
24 -0.049 6.29784e+06 0.333392 -12386.9 search
Search for a zero in the interval [-0.049, 0.333392]:
Func-count x f(x) Procedure
24 0.333392 -12386.9 initial
25 0.332641 -12487.2 interpolation
26 0.141821 -211871 bisection
27 -0.049 6.29784e+06 bisection
28 0.0464103 -6.73183e+06 interpolation
29 0.0463991 -6.7368e+06 interpolation
30 0.0217576 -6.70399e+07 bisection
31 0.00943693 -8.32069e+08 bisection
32 0.00327657 -2.00036e+10 bisection
33 -0.00288379 2.95241e+10 bisection
34 -0.00288281 2.95541e+10 interpolation
35 -0.00134321 2.91718e+11 bisection
36 -0.000573407 3.74685e+12 bisection
37 0.000196394 -9.31829e+13 bisection
38 -0.000188507 1.05416e+14 interpolation
39 -0.000188387 1.05618e+14 interpolation
40 -8.62945e-05 1.09874e+15 bisection
41 -3.52484e-05 1.61214e+16 bisection
42 1.57977e-05 -1.79068e+17 bisection
43 1.09695e-05 -5.34863e+17 interpolation
44 -9.72535e-06 7.67526e+17 bisection
45 -9.72264e-06 7.68167e+17 interpolation
46 -4.55029e-06 7.49357e+18 bisection
47 -1.96412e-06 9.31761e+19 bisection
48 -6.71027e-07 2.3366e+21 bisection
49 6.22061e-07 -2.93295e+21 bisection
50 6.22022e-07 -2.93351e+21 interpolation
51 2.9877e-07 -2.64725e+22 bisection
52 1.37143e-07 -2.73704e+23 bisection
53 5.63303e-08 -3.94984e+24 bisection
54 -2.44828e-08 4.81083e+25 bisection
55 1.59237e-08 -1.74853e+26 interpolation
56 -1.57643e-08 1.8021e+26 interpolation
57 -1.57642e-08 1.80215e+26 interpolation
58 -7.7227e-09 1.53284e+27 bisection
59 -3.70196e-09 1.39158e+28 bisection
60 -1.69159e-09 1.45854e+29 bisection
61 -6.86405e-10 2.18305e+30 bisection
62 3.1878e-10 -2.17937e+31 bisection
63 2.37928e-10 -5.24167e+31 interpolation
64 -1.83812e-10 1.13679e+32 bisection
65 -1.83142e-10 1.14932e+32 interpolation
66 -7.8042e-11 1.48532e+33 bisection
67 2.70577e-11 -3.56395e+34 bisection
68 -2.54922e-11 4.26172e+34 interpolation
69 -2.54395e-11 4.28823e+34 interpolation
70 -1.1157e-11 5.08352e+35 bisection
71 -4.01571e-12 1.09023e+37 bisection
72 3.12555e-12 -2.31219e+37 bisection
73 3.11527e-12 -2.33516e+37 interpolation
74 1.3351e-12 -2.96665e+38 bisection
75 -4.45079e-13 8.00743e+39 bisection
76 4.45009e-13 -8.01121e+39 interpolation
77 4.44565e-13 -8.03524e+39 interpolation
78 2.22213e-13 -6.43427e+40 bisection
79 1.11036e-13 -5.15715e+41 bisection
80 5.54482e-14 -4.14136e+42 bisection
81 2.76541e-14 -3.33831e+43 bisection
82 1.37571e-14 -2.71161e+44 bisection
83 6.80855e-15 -2.23687e+45 bisection
84 3.33429e-15 -1.90455e+46 bisection
85 1.59716e-15 -1.73283e+47 bisection
86 7.286e-16 -1.82531e+48 bisection
Current point x may be near a singular point. The interval [-0.049, 0.333392]
reduced to the requested tolerance and the function changes sign in the interval,
but f(x) increased in magnitude as the interval reduced.
exitflag -5 residual -1.825e+48 x 0.000
Search for an interval around 0.2 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.2 -70202.7 0.2 -70202.7 initial interval
3 0.194343 -77084.9 0.205657 -64083.8 search
5 0.192 -80186.9 0.208 -61748.3 search
7 0.188686 -84851.3 0.211314 -58626.7 search
9 0.184 -92056.7 0.216 -54545.5 search
11 0.177373 -103641 0.222627 -49367.7 search
13 0.168 -123426 0.232 -43058.3 search
15 0.154745 -160554 0.245255 -35767.8 search
17 0.136 -241937 0.264 -27899.7 search
19 0.10949 -478255 0.29051 -20102.3 search
21 0.072 -1.75396e+06 0.328 -13129.9 search
23 0.0189807 -1.01269e+08 0.381019 -7597.33 search
24 -0.056 4.24756e+06 0.381019 -7597.33 search
Search for a zero in the interval [-0.056, 0.381019]:
Func-count x f(x) Procedure
24 0.381019 -7597.33 initial
25 0.380239 -7655.95 interpolation
26 0.16212 -138361 bisection
27 -0.056 4.24756e+06 bisection
28 0.0530598 -4.4731e+06 interpolation
29 0.0530513 -4.47528e+06 interpolation
30 0.0250855 -4.35923e+07 bisection
31 0.0111025 -5.10092e+08 bisection
32 0.00411107 -1.0119e+10 bisection
33 -0.0028804 2.96283e+10 bisection
34 -0.00284653 3.06975e+10 interpolation
35 -0.0011156 5.09061e+11 bisection
36 0.000615334 -3.02833e+12 bisection
37 0.000560904 -3.99847e+12 interpolation
38 -0.000250132 4.51238e+13 bisection
39 -0.00017169 1.39523e+14 interpolation
40 0.000155386 -1.88149e+14 bisection
41 0.000155362 -1.88235e+14 interpolation
42 7.36051e-05 -1.77031e+15 bisection
43 3.27266e-05 -2.01414e+16 bisection
44 1.22873e-05 -3.80566e+17 bisection
45 -8.15197e-06 1.30323e+18 bisection
46 -7.98788e-06 1.3852e+18 interpolation
47 -2.96011e-06 2.72197e+19 bisection
48 2.06767e-06 -7.98661e+19 bisection
49 2.04265e-06 -8.28364e+19 interpolation
50 7.98215e-07 -1.38818e+21 bisection
51 -4.46221e-07 7.94612e+21 bisection
52 -4.1025e-07 1.02249e+22 interpolation
53 1.75997e-07 -1.29506e+23 bisection
54 -1.17127e-07 4.39377e+23 interpolation
55 1.09268e-07 -5.41164e+23 interpolation
56 1.089e-07 -5.46671e+23 interpolation
57 4.66097e-08 -6.97228e+24 bisection
58 -1.56801e-08 1.83129e+26 bisection
59 1.54648e-08 -1.90885e+26 interpolation
60 1.54645e-08 -1.90898e+26 interpolation
61 7.51692e-09 -1.66221e+27 bisection
62 3.54315e-09 -1.58721e+28 bisection
63 1.55627e-09 -1.87305e+29 bisection
64 5.62828e-10 -3.95984e+30 bisection
65 -4.30614e-10 8.8418e+30 bisection
66 -4.28823e-10 8.95302e+30 interpolation
67 -1.81358e-10 1.18357e+32 bisection
68 6.6107e-11 -2.44378e+33 bisection
69 -5.76256e-11 3.68943e+33 interpolation
70 -5.58241e-11 4.05826e+33 interpolation
71 -1.95092e-11 9.50791e+34 bisection
72 1.68056e-11 -1.48744e+35 bisection
73 1.67962e-11 -1.48995e+35 interpolation
74 7.7222e-12 -1.53314e+36 bisection
75 3.1852e-12 -2.18471e+37 bisection
76 -1.35179e-12 2.85809e+38 bisection
77 9.16706e-13 -9.16461e+38 interpolation
78 -8.12515e-13 1.31617e+39 interpolation
79 -7.95959e-13 1.40001e+39 interpolation
80 -2.94536e-13 2.76305e+40 bisection
81 2.06887e-13 -7.97273e+40 bisection
82 2.04526e-13 -8.25199e+40 interpolation
83 8.03507e-14 -1.36093e+42 bisection
84 -4.38248e-14 8.38775e+42 bisection
85 -3.96348e-14 1.1339e+43 interpolation
86 1.82629e-14 -1.15902e+44 bisection
87 1.34317e-14 -2.91347e+44 interpolation
88 -1.06859e-14 5.78588e+44 bisection
89 -1.02418e-14 6.57162e+44 interpolation
90 -4.43446e-15 8.09621e+45 bisection
91 -1.53078e-15 1.96818e+47 bisection
92 1.3729e-15 -2.72827e+47 bisection
93 9.28811e-16 -8.81096e+47 interpolation
94 4.24935e-16 -9.20104e+48 bisection
Current point x may be near a singular point. The interval [-0.056, 0.381019]
reduced to the requested tolerance and the function changes sign in the interval,
but f(x) increased in magnitude as the interval reduced.
exitflag -5 residual -9.201e+48 x 0.000
Search for an interval around 0.225 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.225 -47665.9 0.225 -47665.9 initial interval
3 0.218636 -52407.4 0.231364 -43453.1 search
5 0.216 -54545.5 0.234 -41845.9 search
7 0.212272 -57761.4 0.237728 -39698.3 search
9 0.207 -62731.6 0.243 -36891.9 search
11 0.199544 -70727.5 0.250456 -33333.8 search
13 0.189 -84395.1 0.261 -29002.1 search
15 0.174088 -110076 0.275912 -24003.7 search
17 0.153 -166466 0.297 -18619.7 search
19 0.123177 -330608 0.326823 -13299.1 search
21 0.081 -1.21974e+06 0.369 -8561.42 search
23 0.0213532 -7.0951e+07 0.428647 -4825.67 search
24 -0.063 3.00323e+06 0.428647 -4825.67 search
Search for a zero in the interval [-0.063, 0.428647]:
Func-count x f(x) Procedure
24 0.428647 -4825.67 initial
25 0.427858 -4861.06 interpolation
26 0.182429 -94646.4 bisection
27 -0.063 3.00323e+06 bisection
28 0.0597145 -3.11577e+06 interpolation
29 0.0597087 -3.11671e+06 interpolation
30 0.0284687 -2.972e+07 bisection
31 0.0128487 -3.28518e+08 bisection
32 0.00503876 -5.49063e+09 bisection
33 -0.00277123 3.3266e+10 bisection
34 -0.00252004 4.42269e+10 interpolation
35 0.00113376 -4.83881e+11 bisection
36 0.000794473 -1.40676e+12 interpolation
37 -0.000693135 2.12155e+12 bisection
38 -0.000692845 2.12422e+12 interpolation
39 -0.000321088 2.1334e+13 bisection
40 -0.00013521 2.85654e+14 bisection
41 5.06687e-05 -5.42704e+15 bisection
42 -4.22705e-05 9.34785e+15 interpolation
43 -3.89519e-05 1.19464e+16 interpolation
44 1.65308e-05 -1.56286e+17 bisection
45 -1.12106e-05 5.01102e+17 interpolation
46 9.9356e-06 -7.1981e+17 interpolation
47 9.73275e-06 -7.65763e+17 interpolation
48 3.60062e-06 -1.51241e+19 bisection
49 -2.5315e-06 4.35184e+19 bisection
50 -2.5029e-06 4.50273e+19 interpolation
51 -9.84168e-07 7.40624e+20 bisection
52 5.34563e-07 -4.62177e+21 bisection
53 4.81997e-07 -6.30481e+21 interpolation
54 -2.24803e-07 6.21443e+22 bisection
55 -1.69079e-07 1.46061e+23 interpolation
56 1.28597e-07 -3.31979e+23 bisection
57 1.28019e-07 -3.36497e+23 interpolation
58 5.3889e-08 -4.51133e+24 bisection
59 -2.02411e-08 8.51344e+25 bisection
60 1.6824e-08 -1.48258e+26 interpolation
61 1.54129e-08 -1.9282e+26 interpolation
62 -6.72089e-09 2.32554e+27 bisection
63 -4.36543e-09 8.48642e+27 interpolation
64 4.346e-09 -8.60074e+27 bisection
65 4.346e-09 -8.60074e+27 interpolation
66 2.16814e-09 -6.92694e+28 bisection
67 1.07921e-09 -5.61671e+29 bisection
68 5.3475e-10 -4.61692e+30 bisection
69 2.62518e-10 -3.90236e+31 bisection
70 1.26402e-10 -3.49576e+32 bisection
71 5.83441e-11 -3.5548e+33 bisection
72 2.4315e-11 -4.91111e+34 bisection
73 -9.71396e-12 7.70222e+35 bisection
74 7.30054e-12 -1.81443e+36 interpolation
75 4.85589e-12 -6.16593e+36 interpolation
76 -4.64366e-12 7.05057e+36 bisection
77 -4.64321e-12 7.05259e+36 interpolation
78 -2.26855e-12 6.04729e+37 bisection
79 -1.08122e-12 5.58556e+38 bisection
80 -4.8755e-13 6.09181e+39 bisection
81 -1.90717e-13 1.01774e+41 bisection
82 1.06116e-13 -5.90833e+41 bisection
83 9.72746e-14 -7.6702e+41 interpolation
84 -4.23007e-14 9.32741e+42 bisection
85 2.74869e-14 -3.39959e+43 interpolation
86 -2.72756e-14 3.47921e+43 interpolation
87 -2.68315e-14 3.65484e+43 interpolation
88 -1.32045e-14 3.06649e+44 bisection
89 -6.39094e-15 2.70465e+45 bisection
90 -2.98417e-15 2.65664e+46 bisection
91 -1.28079e-15 3.36023e+47 bisection
92 -4.29101e-16 8.93565e+48 bisection
Current point x may be near a singular point. The interval [-0.063, 0.428647]
reduced to the requested tolerance and the function changes sign in the interval,
but f(x) increased in magnitude as the interval reduced.
exitflag -5 residual 8.936e+48 x -0.000
Search for an interval around 0.25 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.25 -33538.7 0.25 -33538.7 initial interval
3 0.242929 -36928.1 0.257071 -30529.2 search
5 0.24 -38457.2 0.26 -29381.6 search
7 0.235858 -40757.8 0.264142 -27848.8 search
9 0.23 -44315.2 0.27 -25846.6 search
11 0.221716 -50041.9 0.278284 -23309.9 search
13 0.21 -59839.8 0.29 -20224.7 search
15 0.193431 -78273.4 0.306569 -16669.7 search
17 0.17 -118822 0.33 -12848.2 search
19 0.136863 -237145 0.363137 -9083.11 search
21 0.09 -880338 0.41 -5745.34 search
23 0.0237258 -5.15967e+07 0.476274 -3131.27 search
24 -0.07 2.20398e+06 0.476274 -3131.27 search
Search for a zero in the interval [-0.07, 0.476274]:
Func-count x f(x) Procedure
24 0.476274 -3131.27 initial
25 0.475499 -3153.05 interpolation
26 0.20275 -67139.8 bisection
27 -0.07 2.20398e+06 bisection
28 0.0663748 -2.25252e+06 interpolation
29 0.0663711 -2.2529e+06 interpolation
30 0.0319079 -2.10331e+07 bisection
31 0.0146763 -2.20031e+08 bisection
32 0.00606044 -3.15232e+09 bisection
33 -0.00255537 4.24188e+10 bisection
34 0.00175253 -1.3093e+11 interpolation
35 -0.00150122 2.08991e+11 interpolation
36 -0.00143011 2.41726e+11 interpolation
37 0.000499261 -5.67027e+12 bisection
38 -0.000465424 7.00586e+12 interpolation
39 -0.000463785 7.08041e+12 interpolation
40 -0.000198023 9.0938e+13 bisection
41 6.7739e-05 -2.27122e+15 bisection
42 -6.51419e-05 2.55418e+15 interpolation
43 -6.51063e-05 2.55838e+15 interpolation
44 -2.99559e-05 2.62647e+16 bisection
45 -1.23807e-05 3.7203e+17 bisection
46 5.19454e-06 -5.03686e+18 bisection
47 -3.59306e-06 1.52199e+19 interpolation
48 3.0095e-06 -2.59011e+19 interpolation
49 2.79011e-06 -3.25043e+19 interpolation
50 -1.14929e-06 4.65073e+20 bisection
51 8.20411e-07 -1.27853e+21 interpolation
52 -6.23906e-07 2.90702e+21 interpolation
53 -4.39947e-07 8.29091e+21 interpolation
54 3.79227e-07 -1.29451e+22 bisection
55 3.79017e-07 -1.29667e+22 interpolation
56 1.74328e-07 -1.3326e+23 bisection
57 7.19842e-08 -1.89275e+24 bisection
58 -3.03602e-08 2.52286e+25 bisection
59 2.0812e-08 -7.83183e+25 interpolation
60 -1.78924e-08 1.23254e+26 interpolation
61 -1.71229e-08 1.40628e+26 interpolation
62 5.77391e-09 -3.66771e+27 bisection
63 -5.67451e-09 3.86385e+27 interpolation
64 -5.67426e-09 3.86437e+27 interpolation
65 -2.73774e-09 3.44055e+28 bisection
66 -1.26948e-09 3.45082e+29 bisection
67 -5.35356e-10 4.60127e+30 bisection
68 1.98773e-10 -8.98945e+31 bisection
69 -1.68291e-10 1.48122e+32 interpolation
70 -1.58322e-10 1.77902e+32 interpolation
71 6.01394e-11 -3.24584e+33 bisection
72 -4.90913e-11 5.96748e+33 interpolation
73 -4.34968e-11 8.5789e+33 interpolation
74 2.16576e-11 -6.94987e+34 bisection
75 1.79564e-11 -1.2194e+35 interpolation
76 -1.09196e-11 5.42225e+35 bisection
77 -1.04523e-11 6.18255e+35 interpolation
78 3.51839e-12 -1.62096e+37 bisection
79 -3.46696e-12 1.69417e+37 interpolation
80 -3.46652e-12 1.69482e+37 interpolation
81 -1.68184e-12 1.48407e+38 bisection
82 -7.89496e-13 1.43468e+39 bisection
83 -3.43326e-13 1.74456e+40 bisection
84 -1.2024e-13 4.06118e+41 bisection
85 1.02845e-13 -6.49023e+41 bisection
86 1.02401e-13 -6.57504e+41 interpolation
87 4.68513e-14 -6.86499e+42 bisection
88 1.90767e-14 -1.01694e+44 bisection
89 -8.69793e-15 1.0729e+45 bisection
90 -6.26527e-15 2.87068e+45 interpolation
91 5.18938e-15 -5.05194e+45 bisection
92 4.74529e-15 -6.60718e+45 interpolation
93 2.10367e-15 -7.58352e+46 bisection
94 7.82863e-16 -1.47146e+48 bisection
95 -5.37947e-16 4.5351e+48 bisection
Current point x may be near a singular point. The interval [-0.07, 0.476274]
reduced to the requested tolerance and the function changes sign in the interval,
but f(x) increased in magnitude as the interval reduced.
exitflag -5 residual 4.535e+48 x -0.000
Search for an interval around 0.275 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.275 -24277 0.275 -24277 initial interval
3 0.267222 -26773.1 0.282778 -22062.3 search
5 0.264 -27899.7 0.286 -21218.2 search
7 0.259444 -29595.4 0.290556 -20091.1 search
9 0.253 -32218.6 0.297 -18619.7 search
11 0.243887 -36444.3 0.306113 -16756.7 search
13 0.231 -43681 0.319 -14493.4 search
15 0.212775 -57314.2 0.337225 -11889.1 search
17 0.187 -87358.1 0.363 -9095.75 search
19 0.150549 -175253 0.399451 -6352.26 search
21 0.099 -654748 0.451 -3931.67 search
23 0.0260984 -3.86703e+07 0.523902 -2049.76 search
24 -0.077 1.66688e+06 0.523902 -2049.76 search
Search for a zero in the interval [-0.077, 0.523902]:
Func-count x f(x) Procedure
24 0.523902 -2049.76 initial
25 0.523164 -2063.26 interpolation
26 0.223082 -49035.9 bisection
27 -0.077 1.66688e+06 bisection
28 0.0730409 -1.67813e+06 interpolation
29 0.0730389 -1.67827e+06 interpolation
30 0.0354035 -1.53417e+07 bisection
31 0.0165858 -1.52148e+08 bisection
32 0.007177 -1.89593e+09 bisection
33 0.00247258 -4.65877e+10 bisection
34 -0.00223185 6.36486e+10 bisection
35 -0.00223148 6.36802e+10 interpolation
36 -0.00105556 6.0093e+11 bisection
37 -0.000467595 6.90877e+12 bisection
38 -0.000173615 1.34934e+14 bisection
39 0.000120366 -4.04805e+14 bisection
40 0.000118792 -4.21106e+14 interpolation
41 4.60837e-05 -7.21344e+15 bisection
42 -2.66245e-05 3.74085e+16 bisection
43 -2.49329e-05 4.5551e+16 interpolation
44 9.72958e-06 -7.66511e+17 bisection
45 -7.60166e-06 1.60725e+18 interpolation
46 -5.97661e-06 3.30707e+18 interpolation
47 4.13315e-06 -9.99904e+18 bisection
48 4.07771e-06 -1.04125e+19 interpolation
49 1.57799e-06 -1.79677e+20 bisection
50 -9.21728e-07 9.01564e+20 bisection
51 -8.67774e-07 1.0804e+21 interpolation
52 3.2813e-07 -1.99832e+22 bisection
53 -2.69822e-07 3.59396e+22 interpolation
54 -2.42567e-07 4.94662e+22 interpolation
55 1.14461e-07 -4.708e+23 bisection
56 8.78412e-08 -1.04162e+24 interpolation
57 -6.40533e-08 2.68646e+24 bisection
58 -6.35701e-08 2.74818e+24 interpolation
59 -2.58381e-08 4.09284e+25 bisection
60 1.1894e-08 -4.19588e+26 bisection
61 8.73108e-09 -1.06072e+27 interpolation
62 -6.97205e-09 2.08317e+27 bisection
63 -6.95632e-09 2.09733e+27 interpolation
64 -3.0384e-09 2.51692e+28 bisection
65 -1.07944e-09 5.61312e+29 bisection
66 8.79514e-10 -1.03771e+30 bisection
67 8.78078e-10 -1.04281e+30 interpolation
68 3.89056e-10 -1.19886e+31 bisection
69 1.44546e-10 -2.33771e+32 bisection
70 -9.99651e-11 7.0674e+32 bisection
71 -9.86246e-11 7.35952e+32 interpolation
72 -3.81672e-11 1.2698e+34 bisection
73 2.22902e-11 -6.3747e+34 bisection
74 2.09838e-11 -7.64105e+34 interpolation
75 -7.93845e-12 1.41123e+36 bisection
76 6.52267e-12 -2.54407e+36 interpolation
77 5.85509e-12 -3.51726e+36 interpolation
78 -2.77881e-12 3.29026e+37 bisection
79 -2.15284e-12 7.07572e+37 interpolation
80 1.53814e-12 -1.94007e+38 bisection
81 1.52353e-12 -1.99641e+38 interpolation
82 6.08091e-13 -3.13977e+39 bisection
83 -3.07349e-13 2.43169e+40 bisection
84 -2.59365e-13 4.04643e+40 interpolation
85 1.50371e-13 -2.0764e+41 bisection
86 1.41062e-13 -2.5152e+41 interpolation
87 -5.44968e-14 4.36206e+42 bisection
88 4.32827e-14 -8.70685e+42 interpolation
89 3.58478e-14 -1.53256e+43 interpolation
90 -2.18605e-14 6.75807e+43 bisection
91 -2.09457e-14 7.68282e+43 interpolation
92 6.99363e-15 -2.06394e+45 bisection
93 -6.97603e-15 2.0796e+45 interpolation
94 -6.53194e-15 2.53325e+45 interpolation
95 -3.24837e-15 2.05972e+46 bisection
96 -1.60658e-15 1.70253e+47 bisection
97 -7.85692e-16 1.45562e+48 bisection
Current point x may be near a singular point. The interval [-0.077, 0.523902]
reduced to the requested tolerance and the function changes sign in the interval,
but f(x) increased in magnitude as the interval reduced.
exitflag -5 residual 1.456e+48 x -0.000
Search for an interval around 0.3 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.3 -17979.7 0.3 -17979.7 initial interval
3 0.291515 -19863.5 0.308485 -16309.5 search
5 0.288 -20714.1 0.312 -15673.2 search
7 0.283029 -21995 0.316971 -14824 search
9 0.276 -23977.4 0.324 -13715.9 search
11 0.266059 -27173.1 0.333941 -12314 search
13 0.252 -32651.3 0.348 -10612.7 search
15 0.232118 -42985.7 0.367882 -8658.11 search
17 0.204 -65803.2 0.396 -6566.38 search
19 0.164235 -132732 0.435765 -4518.88 search
21 0.108 -499181 0.492 -2721.51 search
23 0.028471 -2.97128e+07 0.571529 -1335.16 search
24 -0.084 1.29241e+06 0.571529 -1335.16 search
Search for a zero in the interval [-0.084, 0.571529]:
Func-count x f(x) Procedure
24 0.571529 -1335.16 initial
25 0.570852 -1343.46 interpolation
26 0.243426 -36676.1 bisection
27 0.0797131 -1.28159e+06 bisection
28 0.0797131 -1.28159e+06 bisection
29 0.0797117 -1.28167e+06 interpolation
30 0.0387841 -1.16281e+07 bisection
31 0.0183203 -1.12695e+08 bisection
32 0.00808845 -1.32328e+09 bisection
33 0.00297251 -2.67999e+10 bisection
34 -0.00214344 7.18471e+10 bisection
35 -0.00212502 7.373e+10 interpolation
36 -0.000855244 1.12956e+12 bisection
37 0.000414533 -9.90706e+12 bisection
38 0.000331668 -1.93441e+13 interpolation
39 -0.000220355 6.59979e+13 bisection
40 -0.000215977 7.0093e+13 interpolation
41 -8.01605e-05 1.37075e+15 bisection
42 5.56563e-05 -4.09483e+15 bisection
43 5.49396e-05 -4.2572e+15 interpolation
44 2.13438e-05 -7.26078e+16 bisection
45 -1.22521e-05 3.83866e+17 bisection
46 -1.14358e-05 4.72073e+17 interpolation
47 4.54583e-06 -7.51557e+18 bisection
48 -3.44499e-06 1.72681e+19 interpolation
49 -2.3895e-06 5.17469e+19 interpolation
50 2.12264e-06 -7.38201e+19 bisection
51 2.12208e-06 -7.38785e+19 interpolation
52 9.94325e-07 -7.18156e+20 bisection
53 4.30448e-07 -8.85203e+21 bisection
54 1.48509e-07 -2.15549e+23 bisection
55 -1.3343e-07 2.97199e+23 bisection
56 -1.33404e-07 2.97369e+23 interpolation
57 -6.29323e-08 2.83259e+24 bisection
58 -2.76963e-08 3.32306e+25 bisection
59 -1.00783e-08 6.89666e+26 bisection
60 7.53966e-09 -1.64721e+27 bisection
61 7.49783e-09 -1.67494e+27 interpolation
62 3.11425e-09 -2.33747e+28 bisection
63 -1.26934e-09 3.45203e+29 bisection
64 9.22455e-10 -8.99435e+29 interpolation
65 -6.61437e-10 2.43971e+30 interpolation
66 4.95817e-10 -5.79217e+30 bisection
67 4.93133e-10 -5.88724e+30 interpolation
68 2.05162e-10 -8.17555e+31 bisection
69 -8.28103e-11 1.24323e+33 bisection
70 6.11756e-11 -3.08368e+33 interpolation
71 -4.14395e-11 9.92112e+33 interpolation
72 3.68436e-11 -1.41162e+34 bisection
73 3.68342e-11 -1.41271e+34 interpolation
74 1.72681e-11 -1.3711e+35 bisection
75 7.48509e-12 -1.6835e+36 bisection
76 2.59357e-12 -4.04677e+37 bisection
77 -2.29794e-12 5.81823e+37 bisection
78 -2.29729e-12 5.82317e+37 interpolation
79 -1.07473e-12 5.68725e+38 bisection
80 -4.63457e-13 7.09212e+39 bisection
81 -1.57819e-13 1.79609e+41 bisection
82 1.47819e-13 -2.18581e+41 bisection
83 1.47375e-13 -2.20563e+41 interpolation
84 7.11876e-14 -1.95701e+42 bisection
85 3.30938e-14 -1.94788e+43 bisection
86 1.4047e-14 -2.54716e+44 bisection
87 -4.9999e-15 5.64833e+45 bisection
88 4.52353e-15 -7.62731e+45 interpolation
89 4.07944e-15 -1.03992e+46 interpolation
90 1.56572e-15 -1.83934e+47 bisection
91 -9.48004e-16 8.28656e+47 bisection
92 -5.03915e-16 5.51739e+48 interpolation
Current point x may be near a singular point. The interval [-0.084, 0.571529]
reduced to the requested tolerance and the function changes sign in the interval,
but f(x) increased in magnitude as the interval reduced.
exitflag -5 residual 5.517e+48 x -0.000
Search for an interval around 0.325 containing a sign change:
Func-count a f(a) b f(b) Procedure
1 0.325 -13566.5 0.325 -13566.5 initial interval
3 0.315808 -15017.6 0.334192 -12280.9 search
5 0.312 -15673.2 0.338 -11791.4 search
7 0.306615 -16660.8 0.343385 -11138.4 search
9 0.299 -18190 0.351 -10286.7 search
11 0.28823 -20657 0.36177 -9210.1 search
13 0.273 -24890.3 0.377 -7904.96 search
15 0.251461 -32887.6 0.398539 -6408.04 search
17 0.221 -50579.4 0.429 -4809.91 search
19 0.177922 -102613 0.472078 -3251.14 search
21 0.117 -388567 0.533 -1890.21 search
23 0.0308436 -2.33123e+07 0.619156 -849.498 search
24 -0.091 1.0232e+06 0.619156 -849.498 search
Search for a zero in the interval [-0.091, 0.619156]:
Func-count x f(x) Procedure
24 0.619156 -849.498 initial
25 0.618567 -854.474 interpolation
26 0.263784 -27977.4 bisection
27 0.0863918 -999326 bisection
28 0.0863918 -999326 bisection
29 0.0863903 -999381 interpolation
30 0.0420431 -9.09699e+06 bisection
31 0.0198695 -8.81967e+07 bisection
32 0.00878271 -1.03289e+09 bisection
33 0.00323931 -2.07026e+10 bisection
34 -0.00230409 5.78517e+10 bisection
35 -0.00228105 5.96212e+10 interpolation
36 -0.000906716 9.47955e+11 bisection
37 0.000467613 -6.90144e+12 bisection
38 0.000403202 -1.07662e+13 interpolation
39 -0.000219551 6.67255e+13 bisection
40 -0.000198318 9.05327e+13 interpolation
41 9.1825e-05 -9.11761e+14 bisection
42 ...
function hw7
fun = @(e) hw7fun(e);
e0 = 0.05:0.025:1.25;
options = optimset('Display', 'iter');
for k = 1:numel(e0)
[e(k), residual(k), exitflag(k), output(k)] = fzero(fun, e0(k), options);
fprintf('\nexitflag %d residual %6.3e x %6.3f\n', exitflag(k), residual(k), e(k));
end
function f = hw7fun(e)
dp=416;
L=1.5;
h=1e-3;
v=0.1;
d=5e-2;
p=2e3;
f = (dp/L)-150*((h*v)/d^2)*((1-e)^2/e^3)-(7/4)*((p*v^2)/d)*((1-e)/e^3);
% endoutput.funcCount
end
end
.
More Answers (0)
See Also
Categories
Find more on Problem-Based Optimization Setup in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)