I am currently working on a little script to visualize TE and TM modes in rectangular and circular waveguides and cavity resonators. I have 3 vector fields (Hx,Hy,Hz) for the magnetic field and 3 vector fields for the electric field (Ex,Ey,Ez) which makes my problem a 4 dimensional one.
I am getting satisfactory results with a combination of slice to plot slices showing the intensity of the electric and magnetic fields and streamslice to show the corresponding field lines within the planes.
My only problem is that streamslice plots field lines equidistant to each other. But since the intensity of electric and magnetic fields in one area is directly proportional to the density of its field lines, I would like to have more field lines in areas with higher intensity and less or no field lines in areas with little intensity.
Since you can access the vector coordinates of the lines produced by streamslice, my idea was just to remove a few to make the line density approximately corresponding to the field intensity. Though I had no luck with this yet.
Any help and suggestions are appreciated
|
|
0
|
|
|
|
Reply
|
PaulS
|
5/2/2010 8:32:04 PM |
|
"PaulS Sochor" <magical_jp@hotmail.com> wrote in message <hrkng4$m75$1@fred.mathworks.com>...
> I am currently working on a little script to visualize TE and TM modes in rectangular and circular waveguides and cavity resonators. I have 3 vector fields (Hx,Hy,Hz) for the magnetic field and 3 vector fields for the electric field (Ex,Ey,Ez) which makes my problem a 4 dimensional one.
> I am getting satisfactory results with a combination of slice to plot slices showing the intensity of the electric and magnetic fields and streamslice to show the corresponding field lines within the planes.
>
> My only problem is that streamslice plots field lines equidistant to each other. But since the intensity of electric and magnetic fields in one area is directly proportional to the density of its field lines, I would like to have more field lines in areas with higher intensity and less or no field lines in areas with little intensity.
>
> Since you can access the vector coordinates of the lines produced by streamslice, my idea was just to remove a few to make the line density approximately corresponding to the field intensity. Though I had no luck with this yet.
>
> Any help and suggestions are appreciated
a few slices of ML code would help...
us
|
|
0
|
|
|
|
Reply
|
us
|
5/2/2010 8:38:04 PM
|
|
Sorry, here is some code which should explain my problem. The density of field lines is almost uniform. Going from the edge to the center the density of field lines should actually be decreasing.
a=100;
b=10;
c=100;
d=sqrt(a^2 + c^2);
T=0.3;
[X,Y,Z]=meshgrid(0:1:a, 0:1:b, 0:1:c);
Hx= (a/d)*sin((pi*X)/a).*cos((pi*Z)/c).*sin(pi*T);
Hy= zeros(size(X));
Hz= -(c/d)*cos((pi*X)/a).*sin((pi*Z)/c).*sin(pi*T);
W= sqrt(Hx.^2 + Hz.^2);
slice(X,Y,Z,W,[],[b],[]);
[hverts haverts]= streamslice(X,Y,Z,Hx,Hy,Hz,[],[b],[],1,'linear');
hlines= streamline([hverts haverts]);
set(hlines,'LineWidth',3,...
'Marker','.',...
'MarkerSize',3,...
'MarkerFaceColor','k',...
'Color','k')
view(0,0),axis([0 a 0 b 0 c])
|
|
0
|
|
|
|
Reply
|
PaulS
|
5/2/2010 10:39:03 PM
|
|
|
2 Replies
1254 Views
(page loaded in 0.019 seconds)
Similiar Articles: Plot field lines of vector fields using streamslice - comp.soft ...I am currently working on a little script to visualize TE and TM modes in rectangular and circular waveguides and cavity resonators. I have 3 vector fields (Hx,Hy,Hz ... getgenbank problem - comp.soft-sys.matlabI'm trying to download Genomes in Progress from NCBI. The accession number,for example, can be "NZ_ACIR00000000". The code is as simple as belo... Rotating a 3D magnetic field plot - comp.soft-sys.matlab ...Plot field lines of vector fields using streamslice - comp.soft ... I have 3 vector fields (Hx,Hy,Hz) for the magnetic field and 3 vector fields for the ... Use functions to make art :D - comp.soft-sys.matlabPlot field lines of vector fields using streamslice - comp.soft ... Use functions to make art :D - comp.soft-sys.matlab Sort vector with out using sort ... vector splitting to many vectors - comp.soft-sys.matlabPlot field lines of vector fields using streamslice - comp.soft ..... why there are now spaces between fields - I ... 1=$1, it causes $0 to be reconstructed using the ... MarkerFaceColor - comp.soft-sys.matlabPlot field lines of vector fields using streamslice - comp.soft ... 'Marker','.',... 'MarkerSize',3,... 'MarkerFaceColor','k',... 'Color','k') view(0,0),axis([0 a 0 b 0 c]) Saving linebreaks in a TEXT field - comp.databases.mysql ...Plot field lines of vector fields using streamslice - comp.soft ... column size/wrap? - comp.databases.mysql Saving linebreaks in a TEXT field - comp.databases.mysql ... Getting X & Y coordinates from the peak of a graph. - comp.soft ...Plot field lines of vector fields using streamslice - comp.soft ..... of all the fields in the nearfield ... an oblique angle (the red graph ... field shift - comp.lang.awkPlot field lines of vector fields using streamslice - comp.soft ... How to get envelope from AM signal without phase shift - comp.dsp ..... wavelength, lambda', along the ... Surface normals? - comp.graphics.api.openglThe bottom line: the programmer's ability is measured ... have shared smooth vertex normals and height fields ... Flux Integral: Numerical Integration of Vector Field through ... Thread Subject: Plot field lines of vector fields using streamsliceSubject: Plot field lines of vector fields using streamslice. From: PaulS Sochor. Date: 2 May, 2010 20:32:04. Message: 1 of 3 Plot field lines of vector fields using streamslice - comp.soft ...I am currently working on a little script to visualize TE and TM modes in rectangular and circular waveguides and cavity resonators. I have 3 vector fields (Hx,Hy,Hz ... 7/23/2012 8:10:57 PM
|