I would like the plot to look better, colour or in anyway
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Tlotlo Oepeng
am 30 Jan. 2023
Kommentiert: Tlotlo Oepeng
am 2 Feb. 2023
i have this code and would like hlep making it look a bit better its not really easy to see evrthing going on there. wheather colour or even a ffrent 3D plot. and also if you add a code for 2d plot at fixed y variable. thank you
n = 0.4
c1 = 4
c2 = 20.05
c3 = 10 %values from literature
k = 0.1 % made up
%------------------------------Fns:
v_i = @(KK) -2*c1*k.*KK
v_r = @(KK,a) -1*KK.^2 - n - 0.5.*a*sqrt(n)
q_i = @(KK,a) ( 4*n*(c1 - c2) + 2.*a*sqrt(n)*(c1 - c3))*k.*KK
q_r = @(KK,a) (1 + c1^2).*KK.^4 - 4*(1 + c1^2)*k^2.*KK.^2 + 2*n*(1 + c1*c2).*KK.^2 + sqrt(n).*a*(1 + c3*c1 ).*KK.^2
X = @(KK,a) v_r(KK,a).^2 - v_i(KK).^2 - q_r(KK,a)
Y = @(KK,a) 2*v_i(KK).*v_r(KK,a) - q_i(KK,a)
%Om_1 = @(KK,a) v_r(KK,a) - sqrt( X(KK,a) + sqrt(X(KK,a).^2 + Y(KK,a).^2))/sqrt(2)
Om_2 = @(KK,a) v_r(KK,a) + sqrt( X(KK,a) + sqrt(X(KK,a).^2 + Y(KK,a).^2))/sqrt(2)
abO = @(KK,a) 2*abs(Om_2(KK,a))
%-------Grid:
KK = -7:0.1:7
[KK,a] = meshgrid(KK)
% %-------Plot:
surf(KK,a, abO(KK,a))
title("Grow Rate of MI"); xlabel("K"); ylabel("a"), zlabel("G(\Omega)")
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 30 Jan. 2023
n = 0.4;
c1 = 4;
c2 = 20.05;
c3 = 10; %values from literature
k = 0.1; % made up
%------------------------------Fns:
v_i = @(KK) -2*c1*k.*KK;
v_r = @(KK,a) -1*KK.^2 - n - 0.5.*a*sqrt(n);
q_i = @(KK,a) ( 4*n*(c1 - c2) + 2.*a*sqrt(n)*(c1 - c3))*k.*KK;
q_r = @(KK,a) (1 + c1^2).*KK.^4 - 4*(1 + c1^2)*k^2.*KK.^2 + 2*n*(1 + c1*c2).*KK.^2 + sqrt(n).*a*(1 + c3*c1 ).*KK.^2;
X = @(KK,a) v_r(KK,a).^2 - v_i(KK).^2 - q_r(KK,a);
Y = @(KK,a) 2*v_i(KK).*v_r(KK,a) - q_i(KK,a);
%Om_1 = @(KK,a) v_r(KK,a) - sqrt( X(KK,a) + sqrt(X(KK,a).^2 + Y(KK,a).^2))/sqrt(2)
Om_2 = @(KK,a) v_r(KK,a) + sqrt( X(KK,a) + sqrt(X(KK,a).^2 + Y(KK,a).^2))/sqrt(2);
abO = @(KK,a) 2*abs(Om_2(KK,a));
%-------Grid:
KK = -7:0.1:7;
[KK,a] = meshgrid(KK);
% %-------Plot:
surf(KK,a, abO(KK,a),'EdgeColor','none')
title("Grow Rate of MI"); xlabel("K"); ylabel("a"), zlabel("G(\Omega)")
figure
contourf(abO(KK,a),20)
colorbar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


