How to find second intersection point?

18 ビュー (過去 30 日間)
Amanda
Amanda 2022 年 9 月 17 日
コメント済み: Star Strider 2022 年 9 月 17 日
Okay, so
My task is to find the intersections points of functions f1 = 1/x and f2 = sqrt(5./2 - (x^2))
I've found one of the intersections points using:
Intersections=find(abs(f1-f2)<=(0.05));
xvalues=x1(Intersections);
But looking at the graphs I see there are two intersections points, so how do I find the other?

回答 (2 件)

Star Strider
Star Strider 2022 年 9 月 17 日
It is easiest to do this symbolically —
syms x
f1 = 1/x;
f2 = sqrt(5./2 - (x^2));
Intx = solve(f1 == f2)
Intx = 
Intxd = double(Intx)
Intxd = 2×1
1.4142 0.7071
.
  6 件のコメント
Amanda
Amanda 2022 年 9 月 17 日
I tried using your code, and got the same values of x. However, looking at the graph, the second x-value is incorrect. We get x = 1.4142, while it seems to be more 1.387
Star Strider
Star Strider 2022 年 9 月 17 日
The symbolic approach solves for and , agreeing with the numeric approach, so I do not see how any other values could be correct.

サインインしてコメントする。


Torsten
Torsten 2022 年 9 月 17 日
x1 = 0:0.0001:1.5;
f1 = 1./x1;
f2 = sqrt(5./2 - (x1.^2));
Intersections = find(abs(f1-f2)<0.00005);
xvalues=x1(Intersections)
xvalues = 1×2
0.7071 1.4142

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by