Solving implicit equation for three variables

조회 수: 2 (최근 30일)
Hirak
Hirak 2018년 11월 8일
답변: Hirak 2018년 11월 24일
I want to solve the supersphere equation x^n+y^n=1 for x_range=y_range=.1:.1:1 and n=.3:.3:3.
I have done the plot with fimplicit command, but that was improper for me since I cannot find the x and y values for the stacked sequence.
Please help.
h=20; %no of points
x_max=1;
x_min=0.1;
y_max=1;
y_min=0.1;
n_max=3;
n_min=0.1;
dx=(x_max-x_min)/h;
dy=(y_max-y_min)/h;
dn=(n_max-n_min)/h;
[i,j,k] = meshgrid(1:h+1,1:h+1,1:h+1);
x= x_min + (i-1).* dx;
n= n_min + (j-1).* dn;
y= y_min + (k-1).* dy;
numElementsN = length(n);
numElementsX = length(x);
numElementsY = length(y);
U = zeros(numElementsX,numElementsN,numElementsY);
for r=1:numElementsN
for s=1:numElementsX
for p=1:numElementsY
z=fzero(findt,0.1:.1: 1, 0.1:.1: 1, 0.3 :.1: 3);
end
end
end
where, the function findt is referred to
function F=findt(x,y,n)
F = x.^n+y.^n-1;

채택된 답변

Hirak
Hirak 2018년 11월 24일
I have found the individual matrices, but now I want to group the matrices taking one cloumn from each, viz.,
for n=.5:.5:5
hold on
f=(@(x,y) (x.^n)+(y.^n)-1);
g=fimplicit(f,[0 1 0 1]);
hold off
hgsave(gca,'f2.fig')
end
line = get(gca, 'Children'); % Get the line object in the current axis of the figure.
p = get(line, 'XData'); % Get the abscissas.
q = get(line, 'YData'); % Get the ordinates.
P=cell2mat(p);
X=P';
Q=cell2mat(q);
Y=Q';
I want to group (X1,Y1), (X2, Y2), (X3,Y3) ..... separately for each column.
How can I do it?

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by