我试图在MATLAB中绘制这个流函数:
psi=lambda*X*Y+0.5*omega*(Y*Y*exp(2*lambda*t)+X*X*exp(-2*lambda*t)
我写了一段代码:
lambda = 1;
omega = 0.4;
t=2;
[X,Y]= meshgrid(linspace(-0.05,0.05,100),linspace(0,0.15,100));
Z = lambda*X*Y+0.5*omega*(Y*Y*exp(2*lambda*t)+X*X*exp(-2*lambda*t));
contour(X,Y,Z,100)
[C,h] = contour(X,Y,Z);
set(h,'ShowText','on','TextStep',get(h,'LevelStep')*2)
colormap cool
它有效,但结果只是一些直线,如:
我很担心,因为情节看起来不像这样。