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: lookang on September 21, 2010, 09:46:20 am



Title: how to make Ejs Data collect over a series of runs of experiments
Post by: lookang on September 21, 2010, 09:46:20 am
how to make Ejs Data collect over a series of runs of experiments?

i adapted the DataCollect() from http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1945msg7137;topicseen#msg7137 into my collision cart applet.

but the data in the table is erase every time i reset the applet,

My attempt to solve this
so i customize the initialize page to allow DataCollect(), remembering that reset truly reset completely.

but i can't get it to work, any suggestion or codes that do this for me to learn from?

basic aim is to get Ejs to collect the data and student analyse the data, instead of getting them to copy the cells in the table.


Title: Re: how to make Ejs Data collect over a series of runs of experiments
Post by: Fu-Kwun Hwang on September 21, 2010, 11:18:10 am
_reset() will reset the whole program, clear memory and start over again.
That is why the data in the table is clear.

You can use _initialize(); instead of _reset();
And you should add one more column for charge q.


Title: Re: how to make Ejs Data collect over a series of runs of experiments
Post by: lookang on September 21, 2010, 12:30:44 pm
_reset() will reset the whole program, clear memory and start over again.
That is why the data in the table is clear.
agreed.

You can use _initialize(); instead of _reset();
i am using it, check my applet the button "init".
but there is still a problem, _initialize() also clear Data in the table, i am not sure why.
or should i use a stored array method to keep the data in another text file? any elegant solution to this problem?

And you should add one more column for charge q.
done.

Oh, i tried to Update EJS jar file. but the file seems to be the old file still.
i attached as attachment ejs_PointCharge.jar  (http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1948.0;attach=3407)


Title: Re: how to make Ejs Data collect over a series of runs of experiments
Post by: Fu-Kwun Hwang on September 21, 2010, 04:17:39 pm
It seems that the only condition for data to be added to the table is when "Record data off" button is pressed.
Is it what you want?
I would suggest you change it back to normal button instead of two state button.

For your case, _initialize() is not required (it is the same as erase table).

Your uploaded jar file was updated on our server. However, your browser is using cached file.
That is the reason you did not find the change in the browser. You can remove attached jar file.

You need to clear the cache (this might not work for some browser) or close the browser and re-start it again (this will work all the time).
   
I modified the code so that it will record data when record is checked and (point  is dragged  or slider is changed).
Please check out attached xml


Title: Re: how to make Ejs Data collect over a series of runs of experiments
Post by: lookang on September 21, 2010, 04:54:12 pm
thanks! i was hoping for reply!
i understand the electric field applet better now


but i actually want to record for different runs of the experiment like 15 to 20 different play and initialize.
like in datalogger, different "runs" can be captured as different data sets?
maybe need to store in txt files? i am just guessing.

(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1948.0;attach=3405;image)

it will have to involve clicking the initialize button, any way to still collect data?

i upload this applet to illustrate my intent more clearly in the applet i have been remixing ;D


Title: Re: how to make Ejs Data collect over a series of runs of experiments
Post by: Fu-Kwun Hwang on September 21, 2010, 05:50:57 pm
You need to ask Paco to add more feature for dataTable GUI element.

You can try to add table dynamically, and add data to different Table.
Or Just add fixed number of table and add data to different table.


Title: Re: how to make Ejs Data collect over a series of runs of experiments
Post by: lookang on September 22, 2010, 10:29:43 am
You need to ask Paco to add more feature for dataTable GUI element.
done.

You can try to add table dynamically, and add data to different Table.
Or Just add fixed number of table and add data to different table.
i am not sure what it means.
i being reading http://www.um.es/fem/EjsWiki/Main/ElementsDataTable and i don't think storing data after the previous runs is possible even if i use _initialize().


but i think i found a work around the problem.
students can open an excel spreadsheet,
select the data table one row only, and copy and paste into the excel sheet.
slowly, play each "run" and copy and paste each run's data table row into the same excel sheet, there by achieving the table for analysis and deduce the trends themselves.

e=0

m1    u1    v1      Dp1 m2   u2     v2    Dp2   pi      pf     KEi   KEf    A      S                  
4.0   1.0   0.5   -2.0   4.0   0.0   0.5   2.0   4.0   4.0   2.0   1.0   1.0   0.0
4.0   2.0   1.0   -4.0   4.0   0.0   1.0   4.0   8.0   8.0   8.0   4.0   2.0   0.0
4.0   3.0   1.5   -6.0   4.0   0.0   1.5   6.0   12.0   12.0   18.0   9.0   3.0   0.0
4.0   4.0   2.0   -8.0   4.0   0.0   2.0   8.0   16.0   16.0   32.0   16.0   4.0   0.0
4.0   5.0   2.5   -10.0   4.0   0.0   2.5   10.0   20.0   20.0   50.0   25.0   5.0   0.0

and so on.

This feature was suggested by student in their feedback form who went through my "research" intervention in Feb 2010
http://sgeducation.blogspot.com/2010/02/virtual-laboratory-ejs-open-source-java.html
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=831.msg6291#msg6291

Google Form which all can see, not edit
https://spreadsheets.google.com/ccc?key=0AjIvSg-TzZrZdGVoQzE5WlVWcU9FREJhaXBLYi1jZ1E&hl=en&pli=1

summary of results
https://spreadsheets.google.com/gform?key=0AjIvSg-TzZrZdGVoQzE5WlVWcU9FREJhaXBLYi1jZ1E&hl=en&pli=1&gridId=0#chart