Find range of values of independent variable so the dependent variable is in a certain range
5 ビュー (過去 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!