Solve systems of equations graphically

6 ビュー (過去 30 日間)
Rytis Lekstutis
Rytis Lekstutis 2021 年 11 月 1 日
コメント済み: Walter Roberson 2021 年 11 月 1 日
Hello, i've searched many webpages and yet can't find a specific and easy answer, so im writting here and hoping to get the answer. How do i plot them to see where the curves crosses graphically?
There is the system:

回答 (3 件)

Bjorn Gustavsson
Bjorn Gustavsson 2021 年 11 月 1 日
You can start investigating the surfaces of the functions f1(x,y) = x.^2+y.^2-29 and f2(x,y) = y.^2-4*x.^2-9 with something like this:
[x,y] = meshgrid(-10:0.01:10,-10:0.01:10);
surf(x,y,x.^2+y.^2-29,ones(size(x))),shading flat
hold on
surf(x,y,-4*x.^2+y.^2-9),shading flat
contour(x,y,x.^2+y.^2-29,[0 0],'r'),shading flat
contour(x,y,-4*x.^2+y.^2-9,[0 0],'b'),shading flat
axis([-10 10 -10 10 -100 50])
view(-37.5,70)
Then from that point you can go whatever direction you see fit. You can for example use this nice tool found on the FEX: fast-and-robust-curve-intersections.
HTH

Walter Roberson
Walter Roberson 2021 年 11 月 1 日
syms x y
fimplicit([x^2 + y^2 == 29, y^2 - 4*x^2 == 9], [-8 8 -8 8])
  1 件のコメント
Rytis Lekstutis
Rytis Lekstutis 2021 年 11 月 1 日
Thank you for the response. One problem is that this fimplicit function doesn't work on Octave and i must do it on Octave. Is there any other easy way to do it?

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


Dave B
Dave B 2021 年 11 月 1 日
I think you're asking how to plot these two implicit functions: you can do that with fimplicit. To see where they cross, I suppose I'd probably make the axis limits a bit bigger, and a grid might be useful?
fimplicit(@(x,y)x.^2+y.^2-29)
hold on
fimplicit(@(x,y)y.^2-4*x.^2-9)
axis([-10 10 -10 10])
grid on
  2 件のコメント
Rytis Lekstutis
Rytis Lekstutis 2021 年 11 月 1 日
編集済み: Rytis Lekstutis 2021 年 11 月 1 日
I have to do it in octave, and it seems like Octave doesn't have a function like fimplicit. Is there any other way to do it? Mainly i just have to solve the equations graphically
Walter Roberson
Walter Roberson 2021 年 11 月 1 日
Octave is off-topic here. You can find Octave discussion lists mentioned at https://savannah.gnu.org/mail/?group=octave
(Sorry, but the purpose of Free Software Foundation projects such as Octave is to ruin the market for proprietary software. FSF believes that softwar ecompanies can and should survive solely by people hiring them to write software or to answer questions. So, if you have a question about Octave, you should be paying someone to answer it for you.)

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by