<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Ou manuel en Portugais du Bresil c'est dit:<br><br>champ(x,y,fx,fy) <br>pas champ(x,y,fx',fy')<br><br>Mais en faire de la deuxième manière le logiciel a travaillé correctement en disposer des résultat correct. Peut être c'est une imprécision de cet manuel,<br><br>--- Em <b>sex, 13/8/10, calixte <i><calixte.denizet@ac-rennes.fr></i></b> escreveu:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>De: calixte <calixte.denizet@ac-rennes.fr><br>Assunto: Re: [scilab-Users] Creating an vector field<br>Para: users@lists.scilab.org<br>Data: Sexta-feira, 13 de Agosto de 2010, 12:40<br><br><div class="plainMail">Hello Pedro,<br><br>Le jeudi 12 août 2010 à 15:40 -0700, Pedro Ledoux a écrit :<br>> Hello<br>> <br>> An supposed charge in in origin. Thus it create a vector field around<br>>
 it. This can be obtained from Coulomb's law. When I tried to create<br>> the vector field caused by this charge I used the commands:<br>> <br>> x=-1:0.1:1;  <br>> y=x;<br>> [X Y]=meshgrid(x,y)<br>> r=sqrt(X.^2+Y.^2)+%eps //I sumed with eps to avoid a error by division<br>> for 0<br>> ax=X./r;<br>> ay=Y./r<br>> champ(x,y,ax,ay)<br>> <br>> The field that I got with those command lines wasn't what I wanted.<br>> but using the code bellow Scilab took the correct field.<br>> <br>> x=-1:0.1:1;  <br>> y=x;<br>> [Y X]=meshgrid(x,y)<br>> r=sqrt(X.^2+Y.^2)+%eps //I sumed with eps to avoid a error by division<br>> for 0<br>> ax=X./r;<br>> ay=Y./r<br>> champ(x,y,ax,ay)<br>> <br>> Acording to manual the first code should give me the correct field. In<br>> Octave a similar code gave me the correct field. Is seems thar or<br>> champ or meshgrid function inverted the things in
 Scilab.<br>> <br>> <br><br>You can compare the results of meshgrid in octave and scilab : they're<br>the same. So your problem comes from champ. You should read carefully<br>the help about champ...<br>For example, in (-1,1)=(x(1),y(21)), you'll find the vector<br>(ax(1,21),ay(1,21))=(1,-1)/sqrt(2).<br><br>In fact, you'll expect to find in point (x(i),y(j)) the vector<br>(ax(j,i),ay(j,i)) (make a draw)<br><br>So the correct command would be : champ(x,y,ax',ay').<br><br>Calixte<br><br>>  <br><br><br></div></blockquote></td></tr></table><br>