NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Easy Java Simulations (2001- ) => Questions related to EJS => Topic started by: tsouthard on June 22, 2009, 10:38:29 pm



Title: Used Deprecated VectorField3D...Any way to translate?
Post by: tsouthard on June 22, 2009, 10:38:29 pm
Hello,

I used the deprecated version of VectorField3D to create a simulation. Is there a way to directly translate to a non-deprecated VectorField3D? I have attached the xml file for the simulation. The problem is that random groups of vectors pop up in random locations in the field and then quickly disappear throughout the simulation. I'm assuming that was one of the reasons not to use it, but it translated most easily to the physical description of the problem, so I used it (the fact that you store xyz position and component in an array).

Thanks in advance!


Title: Re: Used Deprecated VectorField3D...Any way to translate?
Post by: Fu-Kwun Hwang on June 22, 2009, 11:46:31 pm
EJS should still support previous verison deprecated GUI elements.
There is a new VectorField3D.
The old version you need to supply E[][][][7]: the last 7 are for x,y,z, Ex,Ey,Ez and length
The new version you need to supply Ex[][][],Ey[][][],Ez[][][],length[][][]
x,y,z are specifiled by xmin,xmax,ymin,ymax,zmin and zmax properties.
Please check out attached file.
new variables: Ex,Ey,Ez and L have been defined!


Title: Re: Used Deprecated VectorField3D...Any way to translate?
Post by: tsouthard on June 23, 2009, 02:06:44 am
Thank you for your quick response. However, the issue is still present even when using the new version of VectorField3D. The only change I made to the file you uploaded was to remove the old vector field from the view panel. Running the simulation shows random outbursts of vectors (of much greater length than anything I instantiate in code). I haven't seen anything else about this problem - could it be something about the system external to the code that is causing the issue?

PS: I just tried it on another computer and the issue did not show up... I just tried it on a Windows XP tablet edition hp tablet. The issue has been arising on a Mac Pro Quad-Core Xeon running OSX 10.5.6


Title: Re: Used Deprecated VectorField3D...Any way to translate?
Post by: Fu-Kwun Hwang on June 23, 2009, 05:31:40 am
Quote
The problem is that random groups of vectors pop up in random locations in the field and then quickly disappear throughout the simulation.

I did not find the above problem with my computer (Firefox running on Window Vista).
The differerce between old and new vectorField3D is the data structure.
I believe the code to draw all the vector fields are the same.
I was wonder why there is a TraceSet in your code (n elements and x,y,z properties were not defined?)

May I know what kind of simulation you were trying to create? May be there is a better way to make a simpler visualization effect. The current GUI seems to be too complicated to me. Do you really need to show all vectors fields (filled most of the simulation region)?


Title: Re: Used Deprecated VectorField3D...Any way to translate?
Post by: tsouthard on June 23, 2009, 08:20:20 pm
Yes, between the two computers I can test it on, it only has the issue on the Mac. The old vs. new vector fields didn't make a difference - the issue still arose. I don't really understand why I need the trace set either, except for the fact that if I remove it, the vector field is no longer displayed during the simulation. The simulation is for demonstrating the autonomous landing of an aerial robot on a landing pad using the potential field method. Unfortunately, I do need to include the entire field to show how the field behaves at each point, and how it changes if the location of the landing pad is changed. I agree - it does make it rather cluttered, but it is unavoidable in this case.

Any ideas why the issue would arise just on this computer? I would like to try it on another Mac, but I don't have access to another one.


Title: You can remove "TraceSet" safely!
Post by: Fu-Kwun Hwang on June 23, 2009, 09:52:06 pm
I do not have Mac so I can not test it for you.
You can remove TraceSet but you need to the following line from "Initialization" page,too!

 _view.getElement("TraceSet").reset();

It will cause java error if you did not remove the above line (because TraceSet is no longer exists).
That is the reason you did not see vector field if you just remove "TreacSet" from the view.