2012-04-06 48 views
0

我試圖繪製流線型與流功能:繪圖與流功能簡化

psi = Y.*(F.*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M)+ (1 + F.*M.^2*beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M))-(F + (1 + phi.*cos(2.*pi.*X))).*sinh(M.*Y)/(1 + phi.*cos(2.*pi.*X)).*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M)+ (-1 + (1 + phi.*cos(2.*pi.*X)).*M.^2.*beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M)+ (alpha.*((F + (1 + phi.*cos(2.*pi.*X))).*Y.*cosh(2.*(1 + phi.*cos(2.*pi.*X)).*M) + Y.*(-1 + 2.*(1 + phi.*cos(2.*pi.*X)).^2.*M.^2- 2.*M.*Y.*cosh(M.*Y).*((1 + phi.*cos(2.*pi.*X)).*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M)+ (-1 + (1 + phi.*cos(2.*pi.*X)).*M.^2.*beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M))- 2.*(1 + phi.*cos(2.*pi.*X)).*M.*sinh(2.*(1 + phi.*cos(2.*pi.*X)).*M) + 2.*((1 + phi.*cos(2.*pi.*X)).*M.*(Y + (1 + phi.*cos(2.*pi.*X)).^2.*M.^2.*beta).*cosh((1 + phi.*cos(2.*pi.*X)).*M) + (-Y + (1 + phi.*cos(2.*pi.*X)).*M.*2.*((1 + phi.*cos(2.*pi.*X)).^2 - (1 + phi.*cos(2.*pi.*X)).*beta + Y.*beta)).*sinh((1 + phi.*cos(2.*pi.*X).*M)).*sinh(M.*Y)))./8.*((1 + phi.*cos(2.*pi.*X)).*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M) + (-1 + (1 + phi.*cos(2.*pi.*X)).*M.^2.* beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M)).^2)); 

我已經寫了代碼:

M = 0; 
phi = 0.4; 
beta = 0.0; 
theta = 0.65; 
F = theta - 1; 
alpha = 0.0; 

[X,Y]= meshgrid(linspace(-0.5,0.5),linspace(0,1.5)); 
Z = Y.*(F.*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M)+ (1 + F.*M.^2*beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M))-(F + (1 + phi.*cos(2.*pi.*X))).*sinh(M.*Y)/(1 + phi.*cos(2.*pi.*X)).*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M)+ (-1 + (1 + phi.*cos(2.*pi.*X)).*M.^2.*beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M)+ (alpha.*((F + (1 + phi.*cos(2.*pi.*X))).*Y.*cosh(2.*(1 + phi.*cos(2.*pi.*X)).*M) + Y.*(-1 + 2.*(1 + phi.*cos(2.*pi.*X)).^2.*M.^2- 2.*M.*Y.*cosh(M.*Y).*((1 + phi.*cos(2.*pi.*X)).*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M)+ (-1 + (1 + phi.*cos(2.*pi.*X)).*M.^2.*beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M))- 2.*(1 + phi.*cos(2.*pi.*X)).*M.*sinh(2.*(1 + phi.*cos(2.*pi.*X)).*M) + 2.*((1 + phi.*cos(2.*pi.*X)).*M.*(Y + (1 + phi.*cos(2.*pi.*X)).^2.*M.^2.*beta).*cosh((1 + phi.*cos(2.*pi.*X)).*M) + (-Y + (1 + phi.*cos(2.*pi.*X)).*M.*2.*((1 + phi.*cos(2.*pi.*X)).^2 - (1 + phi.*cos(2.*pi.*X)).*beta + Y.*beta)).*sinh((1 + phi.*cos(2.*pi.*X).*M)).*sinh(M.*Y)))./8.*((1 + phi.*cos(2.*pi.*X)).*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M) + (-1 + (1 + phi.*cos(2.*pi.*X)).*M.^2.* beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M)).^2)); 
contour(X,Y,Z,100) 

[C,h] = contour(X,Y,Z); 
set(h,'ShowText','on','TextStep',get(h,'LevelStep')*2) 
colormap cool 

我越來越

Warning: Matrix is singular to working precision. 
Warning: Contour not rendered for non-finite ZData 
> In contour>parseargs at 192 
    In contour at 69 
Warning: Contour not rendered for non-finite ZData 
> In contour>parseargs at 192 
    In contour at 69 

問題是什麼?謝謝。

回答

1

你分割singluar矩陣:(F +(1 +披* COS(2 * PI * X))。)

*的sinh(M. * Y)/ (1。 (2 * PI * X)+披* COS)

我想你斜線前還缺少點:

M = 1; 
phi = 0.4; 
beta = 0.0; 
theta = 0.65; 
F = theta - 1; 
alpha = 0.0; 
[X,Y]= meshgrid(linspace(-0.5,0.5),linspace(0,1.5)); 
Z = Y.*(F.*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M)+ (1 + F.*M.^2*beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M))-(F + (1 + phi.*cos(2.*pi.*X))).*sinh(M.*Y)./(1 + phi.*cos(2.*pi.*X)).*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M)+ (-1 + (1 + phi.*cos(2.*pi.*X)).*M.^2.*beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M)+ (alpha.*((F + (1 + phi.*cos(2.*pi.*X))).*Y.*cosh(2.*(1 + phi.*cos(2.*pi.*X)).*M) + Y.*(-1 + 2.*(1 + phi.*cos(2.*pi.*X)).^2.*M.^2- 2.*M.*Y.*cosh(M.*Y).*((1 + phi.*cos(2.*pi.*X)).*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M)+ (-1 + (1 + phi.*cos(2.*pi.*X)).*M.^2.*beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M))- 2.*(1 + phi.*cos(2.*pi.*X)).*M.*sinh(2.*(1 + phi.*cos(2.*pi.*X)).*M) + 2.*((1 + phi.*cos(2.*pi.*X)).*M.*(Y + (1 + phi.*cos(2.*pi.*X)).^2.*M.^2.*beta).*cosh((1 + phi.*cos(2.*pi.*X)).*M) + (-Y + (1 + phi.*cos(2.*pi.*X)).*M.*2.*((1 + phi.*cos(2.*pi.*X)).^2 - (1 + phi.*cos(2.*pi.*X)).*beta + Y.*beta)).*sinh((1 + phi.*cos(2.*pi.*X).*M)).*sinh(M.*Y)))./8.*((1 + phi.*cos(2.*pi.*X)).*M.*cosh((1 + phi.*cos(2.*pi.*X)).*M) + (-1 + (1 + phi.*cos(2.*pi.*X)).*M.^2.* beta).*sinh((1 + phi.*cos(2.*pi.*X)).*M)).^2)); 
contour(X,Y,Z,100) 
[C,h] = contour(X,Y,Z); 
set(h,'ShowText','on','TextStep',get(h,'LevelStep')*2) 
colormap cool 

此外,一定要改變M至看重來自不同0

enter image description here

+0

謝謝拉斯曼,這非常有幫助,我只是改變了M,並把斜槓前的點,但我仍然得到相同的警告。我認爲問題仍然是Z. – sani 2012-04-07 07:50:43

+0

與M = 1,請參閱上面的圖 – Rasman 2012-04-07 10:58:18

+0

注意我剛剛添加完整的代碼 – Rasman 2012-04-07 10:59:15