Plot field lines of vector fields using streamslice

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
PaulS
5/2/2010 8:32:04 PM
comp.soft-sys.matlab 206976 articles. 0 followers. lunamoonmoon (258) is leader. Post Follow

2 Replies
2531 Views

Similar Articles

[PageSpeed] 54
"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
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
PaulS
5/2/2010 10:39:03 PM
Reply:
Similar Artilces:

Vector website
vector.org.uk got hacked by the Brazilian Boyz, our script-kiddy fans down there. Stephen and Adrian are both in Italy without mirrors packed; we'll have the front page restored as soon as possible. Apologies. Vector is back online at www.vector.org.uk Stephen Taylor editor@vector.org.uk On Jun 6, 2:22 pm, "Stephen Taylor <edi...@vector.org.uk>" <StephenTaylorF...@googlemail.com> wrote: > vector.org.uk got hacked by the Brazilian Boyz, our script-kiddy fans > down there. Stephen and Adrian are both in Italy without mirrors > packed; we'l...

Re: bode plot program?
On Wed, 6 Sep 2006 20:41:58 +0200, Heiko Arnemann wrote: > http://www.hpcalc.org/hp49/math/misc/boderv8x1.zip > is working on HP 49G with ROM 2.09 > > it requires the "get it": > http://www.hpcalc.org/hp49/math/symbolic/neopv8x1.zip Installation went fine, but I have a problem. There's no picture. when I enter the data and say I want a BodePlot, when I click Draw, the grid appears but there's no function drawn, just the crosshair. help! On Thu, 7 Sep 2006 22:27:37 +0200, sNNooPY wrote: > On Wed, 6 Sep 2006 20:41:58 +0200, Heiko Arnemann wrote: > >...

Re: Having trouble to compare negative number using %if #2
Test shows that these will work, outside the macro. You really should fix the macro "system". This quoting these expresions is macro 101. 38 %let x = %nrstr(-0.21%%); 39 %macro t; 40 %if &x= %then %put 'Null'; 41 %else 42 %put 'Not Null'; 43 %mend; 44 %t; 'Not Null' 45 46 %let x = %str(-0.21%%); 47 %macro t; 48 %if &x= %then %put 'Null'; 49 %else 50 %put 'Not Null'; 51 %mend; 52 %t; 'Not Null' 53 54 %let x = -0.21%; 55 %let x = %superq(x); 56 %macro t; 57 %if &x= %then %put &...

using session values
I have done alot of web work in all sorts of languages but I have never used the simple cookie. Question is How does one set and retrieve a simple session cookie. All it will do is have an image change on 1 page only with every new visitor, there are 5 images it should be random and stay the same unless the session is ended. Sounds pretty simple but I cannot find simple examples of a cookie doing anything similar to this. I found oodles of stuff on what a cookie is and how it works but I could use an example, even if someone knows a website that has simple clear examples, and to prove my igno...

Re: Where to put using declarations?
On Fri, 02 Jun 2006 18:43:45 -0400, Greg Herlihy wrote: [...] > In this example, sp is declared as a stunted::shared_ptr - even though > boost::shared_ptr appears to be the type intended. Furthermore, since > stunted::shared_ptr hides the shared_ptr name in the global namespace, > there is no name conflict - and this code compiles successfully despite > the likely error. Right. But like I said, in *some* cases it can definitely error. It just depends how lucky you are, I guess: //foo.hh namespace foo { struct shared_ptr { void* p; }; } ///.... //something....

warnings when using level 4 in msvc 6 (how to get rid of them)
I compile my code using Visual c++ 6 set to warning level 4. One issue I have is that when including wxWidgets headers I gets lots of warnings - well basically the same warning repeated. This started happening at around version 2.5.2. Now, I don't really want to disable the warnings for my project. I could disable and re-enable them around the wx-includes but first I wanted to check 2 things: 1. Are these warnings safe to ignore in the wxWidgets library? 2. Would it be possible to add the relevant #pragma warning(disable:xxx) / #pragma warning(default:xxx) to the start and end...

Partner Plus 206 module lines continuously ring.
Folks, We have a Partner Plus R3.1 system installed here. Last week, one of the 206 expansion cards stopped working. Lines 5&6, as well as the extensions attached to the 206 card worked intermittently, and would drop in the middle of calls. Accordingly, we purchased another expansion card (206E R3.1). Removed the old card, put in the new card. The extensions now work fine, however, lines 5&6 are not functioning correctly. Symptoms: When line 5 is plugged in, it will start ringing on all the extensions, when the line is picked up, it hangs up immediately. When the extens...

help plot log[f[t]] vs a parameter using an ODE
I've solved the following equation for y[t]. eqn = y'[t] == a (y[t]/((y[t])^2 + b )) - c y[t] + d keqn = eqn /. {a -> 10 , d -> 0.1 , c -> 1 , b -> 10 } ksol = NDSolve[{keqn, y[0] == 0}, y, {t, 0, 200}] Plot[y[t] /. ksol, {t, 0, 200}, PlotRange -> All]; Now I would like to plot the log of y[t] while varying a over a range of values ( 0-40) How will I accomplish this? It seems like I would have to solve the DE while varying a a little at a time then take the log of it? At first I thought the following will do the trick, but it didn't. I was tr...

Re: How to use syncsort in sas in mainframe #2
Note that the intermediate SAS data set (the one which is to be input to the sorting step) can be a DATA step view. That will save a pass through the data and a bunch of disk space. On Tue, 28 Dec 2004 08:57:40 -0500, Michael Raithel <michaelraithel@WESTAT.COM> wrote: >Dear SAS-l-ers, > >Addanki posted the following: > >> I need to sort 130 million record file how can i sort on >> mainframe using sas? I know i can use syncsort seperately! >> with flat files... But will anybody suggest me how can i use >> syncsort in sas Thanks Addanki >> > &...

Using interactive Python for HTTPS dialog with server
Would the knowledgeable folks among you say I should have no great difficulty writing a script in Python that can simulate having an operator at a desktop keying and sending transactions to an HTTPS connection and receving responses. The script would read a file of data containing info that would otherwise have been keyed by an operator, and be expected to respond to any returning approval or error codes after sending the original data via a secure connection, as though it had been done in a web page ? ...

Plotting
Hi, I am trying to plot a series of randomly generated line segments. However for some weird reason the following code is not plotting all of them. For example, if I were to set the num variable to 3, it only shows either 1 or 2 lines. If i set it to 6, it only displays 4 lines... I'm lost!! If you need more parts of my code please let me know. Thanks. for i = 1:num if (i == 1) axis([0 film_length 0 film_length]); hold all; end X{i} = originX(i,1):0.1:endX(i,1); Y{i} = slope(i,1) * X{i} + intercept(i,1); p = plot(X{i},Y{i}); if (type...

how to update a datetime field
How can I update only the date portion of a datetime field? Example: datetime field = '3/12/1995 12:05:50 PM' How can I change just the day '12' to a '7' Thanks On Tue, 11 Jan 2005 20:56:17 GMT, RDRaider wrote: >How can I update only the date portion of a datetime field? >Example: >datetime field = '3/12/1995 12:05:50 PM' > >How can I change just the day '12' to a '7' > >Thanks Hi RDRaider, You're using an ambiguous date format. Is it december 3rd or March 12th? DECLARE @dt datetime SET @dt = '1995-12-03T12...

How to plot shaded relief image
Dear guys: How to use IDL to plot shaded relief image, just like http://denali.gsfc.nasa.gov/gridview/index.html? Thanks very much! Dave Dave writes: > How to use IDL to plot shaded relief image, just like > http://denali.gsfc.nasa.gov/gridview/index.html? Thanks very much! 1. Download the GRIDVIEW application. 2. Download a GRID. Otherwise, you could take your topographic data and drape another dataset over the top of it as a texture map: http://www.dfanning.com/ographics_tips/imgtex.html Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coy...

Formatting the contents of a text area form field
Hi all On my site I get users to enter a load of information in a textarea box, however when i save this data to my mysql DB and then retrieve it, it comes out without all the formatting, like new paragraphs and new lines. Can anyone tell me how you can capture the data entered into such a field with all the formatting the user has entered like new paragraphs etc? On 15 Jan 2006 04:57:20 -0800, in <1137329840.465536.212360@z14g2000cwz.googlegroups.com> (comp.lang.php) "monomaniac21" <marcrice20@msn.com> wrote: > Hi all > > On my site I get users to enter a ...

How to compile Cypress Vendax using Keil?
I have installed SETUP_FX2LP_DVK_1004.exe from Cypress. This created a CYPRESS folder on my C: drive. When I call up c:\Cypress\USB\Examples\FX2LP\Vend_Ax.uv2. A eeprom.c shows in the project "as missing." Anyone know how to compile this project from Cypress? I have read so much Cypress material, some makes no sense. I am trying to produce Vendax comma-delimited (hex commands) file to cut-and-paste into my program. Please help. ...

Explicit use of this pointer
I was reading through some C++ style guides for best practice rules that I found via this web site: http://www.chris-lott.org/resources/cstyle/ And there was conflicting advice on whether to reference member variables and/or functions from within the class by using the this pointer explicity. E.g., this->some_fun(); this->m_foo; Some people feel that this improves clarity by letting the reader know the scope of the function being called. Other people state that this syntax shouldn't be used. I guess I can almost see the argument for knowing the scope of the function, but I don...

Give plot in figure a position/dimension.
Hi, in an existing figure i want to plot. I experiment with subplot, but I cannot give a position for the plot. I know the Order subplot(1,1,1); subplot('Position',[3 3 100 20]); plot(f,MX); but it does not work :( he always takes the dimensions from 1,1,1 oder 2,1,2 or so... but not the position?? Please help me... In Advance Anis > in an existing figure i want to plot. > I experiment with subplot, but I cannot give > a position for the plot. > I know the Order > > subplot(1,1,1); > subplot('Position',[3 3 100 20]); > plot(f,MX); > > but i...

Using CSS and JavaScript to remove notices on demand
It occurred to me that it seems to be fairly easy to make visually strong elements turn into normal elements or disappear. The need for such effects arises when we wish to do everything possible to convey an important message, yet let the user then read the rest of the page without being distracted by large print, bright colors, blinking, colorful image, etc. If you put such an element inside a div element and use onclick="this.style.visibility = 'hidden'" then clicking on it removes it from the page without changing the layot. You could alternatively set ...

how to use fft
I have a data which have 3000 elements , I want to take 1400 of them and find their fft. How can I do it ? I can write the program. Thank you pierre wrote: > > > I have a data which have 3000 elements , I want to take 1400 of > them > and find their fft. How can I do it ? I can write the program. > Thank > you > > step 1: crop out 1400 samples out of the 3000 step 2: (optional) Apply window to reduce side-lobes, hamming, hanning, etc step 3: apply fft. results will be complex, plot abs of the first 700 samples of the result. Incidently, it sounds like you haven...

oracle spatial: change the spatial tolorance and round the values in the fields (hope to solve ORA-04031 messages with this)
Hello, I want to change the tolorance from: 0.00001 into: 0.005, Is there a way to update this column so the value is rounded and simplified, so the value is filled with values which do not contain too much decimals behind the "."? I want to change the tolorance of a table that i have, so oracle doesnt have to do unused work(and give error ORA-04031: ..."large pool".. on index usage). query i want to run: pand table: 13124 records with polygons number table: 14070 records with points CREATE TABLE NUMMER_IN_PAND AS SELECT PAND.GID AS PAND_ID, NUMMER.GID AS NUMMER_I...

RH9 and alias using tcsh shell
I am using RH9 and tcsh shell, I would like to include some alias so that they run everytime I login. In which file/s should I include them? I have tried in several (the same ones as I have in a unix machine) but no succed Examples of aliases I would like to include alias rm 'rm -i' alias ls 'ls -s' .... Thanks jeguilloal jeguilloal wrote: > I am using RH9 and tcsh shell, > I would like to include some alias > so that they run everytime I login. > > In which file/s should I include them? > I have tried in several (the same ones &...

Re: Summing top 300 values of a particular field using SQL #3
On Wed, 25 Apr 2007 08:38:57 -0700, Pardee, Roy <pardee.r@GHC.ORG> wrote: >How about: > >Proc sql inobs = 300 nowarn ; > select sum(field1) as answer > from my_table > order by field1 descending > ; >Quit ; Will reflect the first 300 rows read, not the 300 rows with the largest values. To see this, try Proc sql inobs = 3 nowarn ; select sum(age) as answer from sashelp.class order by age descending ; Quit ; > >? > >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of >Hari >Sent: Tues...

to get 3d plot
have a code for MVDR algorithm ,how to convert it into 3d plot. On Mar 18, 5:16=A0am, "ramya ramya" <ramya_...@yahoo.co.in> tersely wrote: > have a code for MVDR algorithm ,how to convert it into 3d plot. (As if I know what every acronym in the world is)...perhaps you might try scatter3() or surf(), or even better, a more complete post describing what you're trying to plot (what is the form of the data and what do you want it to look like). ...

How do I make a simple password field....more.
I want to password protect the continued running of a section of javascript. What I need is for the user to see a login field, they type a code in, if it is good, the script continues, if bad, it stops dead. I would like to base the password on julian date. Also, how do I time out a group of statements after a preset amount of time like 1 minute or so. I am not a Java programmer, but if examples are shown, I can usually figure out the specific details. THANKS in advance. "Wayne Davis" <waydavis58@hotmail.com.NOSPAM> writes: > I want to password protect the continued ...

Scheme code for getting unit vector
recently there's a fun implementation for a function that returns the unit vector of a given vector in any dimension. Various people has given code in Mathematica, scheme, java, c, javascript, python, ruby... One of them is: ;; Chicken Scheme. By the.brown.dragon...@gmail.com (require 'srfi-1) (define (normalize vec) (map (cute / <> (sqrt (reduce + 0 (map (cute expt <> 2) vec)))) vec)) i don't have experience coding Scheme lisp. Is it possible to make this work in scsh? (i'm running scsh 0.6.4) Also, what kinda lib is srfi-1? I imagine it is possible to do wit...