Non-linear Implicit function plot

2 ビュー (過去 30 日間)
Chaluvadi Kiran
Chaluvadi Kiran 2017 年 1 月 2 日
回答済み: Roger Stafford 2017 年 1 月 2 日
Hi I am trying to plot an implicit function. My function contains both scalars and vectors (a*x^3) - (3*b*(norm(-V1+(x+y)*V2)^3)) = 0, where a, b are scalars and V1 and V2 are some unit vectors. I want to plot 'x vs y'. I tried various methods like fimplicit, fplot, ezplot and also mupad (plot(plot::Implicit2d()) But failed Is there is a way to plot this ?

回答 (2 件)

Star Strider
Star Strider 2017 年 1 月 2 日
There probably is a way to plot it, but you have to tell us (and MATLAB) what you want as your independent variables.
Guessing here. See if this does what you want:
a = 5.5;
b = 2.3;
V1 = [1; 2; 3];
V2 = [2; 4; 7];
f = @(x,y) (a*x.^3) - (3*b*(norm(-V1+(x+y).*V2).^3));
figure(1)
ezsurf(f, [-5 5 -5 5])
  1 件のコメント
Chaluvadi Kiran
Chaluvadi Kiran 2017 年 1 月 2 日
編集済み: Chaluvadi Kiran 2017 年 1 月 2 日
Hi, I am expecting a 2D plot(x vs y) not 3D. My implicit function is (a*x^3) - (3*b*(norm(-V1+(x+y)*V2)^3)) = 0 (equals to zero)

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


Roger Stafford
Roger Stafford 2017 年 1 月 2 日
You could plot it using a third variable, t:
n = 200;
t = linspace(-2,2,n); % <-- Choose appropriate range for t
for k = 1:n
x(k) = (3*b/a)^(1/3)*norm(-V1+t(k)*V2);
y(k) = t(k)-x(k);
end
plot(x,y,y-)
axis equal
The trick is to choose the appropriate range for variable t to get the desired ranges for x and y.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by