how to plot the 3d graph
조회 수: 1 (최근 30일)
이전 댓글 표시
dgh:= 0.09954;
Delta:=-0.68429;
sx:=-0.01098;
sy:= 0.05126;
Esup:=sx*x+sy*y+dgh*((x^2+y^2)/2+Delta*(x^2-y^2)/2)^(1/2);
Einf:=sx*x+sy*y-dgh*((x^2+y^2)/2+Delta*(x^2-y^2)/2)^(1/2);
how to plot the graphs of the two functions in the same plot.
댓글 수: 2
Walter Roberson
2016년 2월 9일
Please confirm that you want to plot within a MuPad notebook and not within MATLAB.
답변 (1개)
John BG
2016년 3월 7일
Hi Akshaya
the straight way to visualize the function boundaries is, for Esup
dgh= 0.09954;
Delta=-0.68429;
sx=-0.01098;
sy= 0.05126;
x=[-20:1:20];y=[-20:1:20]
[X,Y]=meshgrid(x,y)
Esup=sx*X+sy*Y+dgh*(abs((X.^2+Y.^2)/2+Delta*(X.^2-Y.^2)/2)).^.5
figure(1);surf(X,Y,Esup)

and Einf:
figure(2);surf(X,Y,Einf)

I had to add the abs() otherwise the boundaries showed complex values when attempting to solve sqrt of negative values.
To plot both boundaries in same graph use command hold:
figure(1);hold all;surf(X,Y,Einf)

If you find this answer of any help solving your question, please click on the thumbs-up vote link,
thanks in advance
John
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!