how rotate a number as an vector in quiver plot?

2 vues (au cours des 30 derniers jours)
Paul
Paul le 9 Août 2015
Commenté : Paul le 11 Août 2015
Hi all, I am having a very strange issue with rotating vector along the circle that I cannot seem to debug - I am hoping fresh eyes will help. The problem is best described if I explain it as follows:
r=1; % radius of nodes in cm
n=9; % number of (equally spaced) nodes around the half-circumference
theta=-pi/2:pi/(n-1):+pi/2;% angular position from 12 o'clock
x=r*sin(theta)';
y=r*cos(theta)';
%%Type in modal matrix (i.e. mode shapes are columns)
% Dummy data for you to replace
w=[4.03,-2.75;4.8,-1.17;4.41,-1.5;4.29,-2.42;
3.86,-2.88;3.53,1.31;3.39,1.3;
3.29,1.46;4.56,1.7];
% Set in-plane components of motion to zero since they are unmeasured
u=zeros(size(w));
v=zeros(size(w));
% Type in the natural frequencies here
fn=[171,245];
for ii=1:length(fn)
figure(ii)
quiver(y,x,v(:,ii),w(:,ii))
hold on
plot(y,x,'-r','Linewidth',3) % overlay geometry
title(['Mode shape of ', num2str(fn(ii)),' Hz mode'])
xlabel('x (cm)')
ylabel('y (cm)')
end
I want the vector be on the circumference of the circle but has an direction that likes passing from the centre of the circle instead of being perpendicular at each point to the circumference of the circle.
  3 commentaires
Paul
Paul le 11 Août 2015
Hi Adam many thanks for your comment, I have modified my code but still there is one problem on it, I wonder to have a vector on the circumferential of my circle and has a direction from the centre line of my circle. but in case just few of them are passing from the centre of my circle.
clc;clear ;close;
%% Geometry of accelerometer positions (in cm) - edit r and/or n if required
r=1; % radius of nodes in cm
n=9; % number of (equally spaced) nodes around the half-circumference
theta=-pi/2:pi/(n-1):+pi/2;
% angular position from 12 o'clock
x=r*sin(theta)'; y=r*cos(theta)';
%% Type in modal matrix (i.e. mode shapes are columns)
% Dummy data for you to replace
w=[-6.07,-1.74;-6.06,-0.212;-2.67,+3.24;-1.42,1.43; 3.22,0.983;3.96,0.66;6.37,-0.829; 6.64,-2.55;8.4,-3.27];
% Set in-plane components of motion to zero since they are unmeasured
% Type in the natural frequencies here
fn=[50,175];
%% Plot mode shapes as quiver plots - you should not need to edit this part
for ii=1:length(fn)
figure(ii)
quiver(x,y,x,w(:,ii))
hold on
plot(x,y,'-r','Linewidth',3) % overlay geometry
title(['Mode shape of ', num2str(fn(ii)),' Hz mode'])
xlabel('x (cm)')
ylabel('y (cm)')
end
Paul
Paul le 11 Août 2015
No idea?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Vector Fields dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by