Hello there!
I'm having throuble with a quiver plot. There's this M vector field I want to display over this curved ribbon callend by plotaFita( ) in the code bellow. All vectors should look the same size but it looks a lot bigger in the curve maximum. Any ideias? It's funny because when I put the zero in quiver scale I do got a field with constant norm, but it's completly different, with the arrows all over the origin of the plot.
Omega = @(theta) 2*atan( exp( (theta-theta0)/delta ) );
Mr = @(theta) Ms*sin(fi).*sin(Omega(theta));
Mtheta = @(theta) Ms*cos(Omega(theta));
Mz = @(theta) Ms*cos(fi).*sin(Omega(theta));
Mx = @(theta) Mr(theta).*cos(theta) - Mtheta(theta).*sin(theta) ;
My = @(theta) Mr(theta).*sin(theta) + Mtheta(theta).*cos(theta) ;
XYZ = plotaFita(dr,dz,Raio,Nx,Nz); hold on;
[n,m] = size(XYZ);
X = XYZ(:,1:(m/3)); Y = XYZ(:,(m/3 + 1):(2*m/3)); Z = XYZ(:,(2*m/3+1):end);
Theta = atan(Y./X);
quiver3(X,Y,Z,Mx(Theta),My(Theta),Mz(Theta));
%quiver3(X,Y,Z,Mx(Theta),My(Theta),Mz(Theta),0);

6 件のコメント

KSSV
KSSV 2022 年 8 月 16 日
We cannot run your code as the function: plotaFita is not given here. One suggestion is replace atan with atan2.
Gabriel Silva
Gabriel Silva 2022 年 10 月 12 日
I'm attaching here this function so you can do it.
Gabriel Silva
Gabriel Silva 2022 年 10 月 16 日
Do anyone else got any other ideia?
KSSV
KSSV 2022 年 10 月 16 日
It is not a complete code. How you expect us to run?
XYZ = plotaFita(dr,dz,Raio,Nx,Nz); hold on;
dr, dz, Raio, Nx, Nz not defined. Okay, we can go ahead with some values. But how about variables in the below lines?
Omega = @(theta) 2*atan( exp( (theta-theta0)/delta ) );
Mr = @(theta) Ms*sin(fi).*sin(Omega(theta));
Mtheta = @(theta) Ms*cos(Omega(theta));
Mz = @(theta) Ms*cos(fi).*sin(Omega(theta));
Gabriel Silva
Gabriel Silva 2022 年 10 月 16 日
編集済み: Gabriel Silva 2022 年 10 月 21 日
Oh, sorry, I forgot about these values.
I use:
dr = 2e-06 ; dz = 1.8e-6; Raio = 3.1831e-05; Nx = 15; Nz = 10;
and
theta0 = pi/2; delta = 1.0504e-06; Ms = 813 ; fi = pi/2
Gabriel Silva
Gabriel Silva 2022 年 10 月 21 日
Do you think you can run now, KSSV?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeVector Fields についてさらに検索

タグ

質問済み:

2022 年 8 月 15 日

編集済み:

2022 年 10 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by