Find range of values of independent variable so the dependent variable is in a certain range
3 次查看(过去 30 天)
显示 更早的评论
Given a function for example f(x) = x^3+x^5 is there a way you can determine all values of x such that the absolute value of f(x) is less than 5?
0 个评论
回答(1 个)
John D'Errico
2021-3-21
No. Given a completely general nonlinear function as a black box, so you cannot see inside the box, just pass in values, the answer is an uncategorical no.
Given a low order polynomial (of sufficiently low degree that we can do things like solve for roots of said polynomial) the problem is simpler. It would involve finding roots of a related set of polynomials, where that related set of polynomials is caused to have the constant term be adjusted carefully.
Thus for the polynomial f(x) == x^3 + x^5, we need to solve for the roots of the associated polynomials f(x)-5 and f(x)+5. Given that information, you can now determine intervals as needed. No, I won't write the code for that, because this problem is far more complex for a general blackbox function, and that is surely what you want. If it really is for the simple polynomial you wrote, that is trivial, and likely part of a homework assignment, and I don't do homework.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polynomials 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!