How to solve a nonlinear equation?

I have an equation as follows
x^(8.5)+3*x^(2)=3000
How can I solve for x?
Thanks for any help!

답변 (1개)

Matt J
Matt J 2020년 10월 20일
편집: Matt J 2020년 10월 20일

0 개 추천

[x,fval] = fzero( @(x) x^(8.5)+3*x.^2-3000,nthroot(3000,8.5))
x = 2.5629
fval = 4.5475e-13

댓글 수: 7

CS
CS 2020년 10월 20일
Thanks!
What is the function of nthroot(3000,9)?
Matt J
Matt J 2020년 10월 20일
You're welcome. Please Accept-click if you are satisfied with the answer.
nthroot(3000,9) is the initial guess provided to fzero. With such a large exponent, we can expect the left hand side of the equation to be approximately x^9.
CS
CS 2020년 10월 20일
And what is fval indicating?
It is the value of the function at the point found by fzero. You use it to see if the point is approximately a root. Equivalently, you could do,
fun=@(x) x^(8.5)+3*x.^2-3000;
x = fzero( fun,nthroot(3000,8.5)),
x = 2.5629
fval=fun(x)
fval = 4.5475e-13
How about the below one?
[x,fval] = fzero( @(x) ((1/(3.52*10.^(22)))*x^(8.14))+(1/207000)*x.^2-4.52,0)
It gives the error
Exiting fzero: aborting search for an interval containing a sign change
because complex function value encountered during search.
(Function value at -0.0282843 is -4.52+3.0076e-36i.)
Check function or try again with a different starting value.
How to solve this?
[x,fval] = fzero( @(x) ((1/(3.52*10.^(22)))*abs(x)^(8.14))+(1/207000)*x.^2-4.52,0)
x = -656.6949
fval = -8.8818e-16

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Optimization에 대해 자세히 알아보기

질문:

CS
2020년 10월 20일

댓글:

2020년 10월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by