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

Easy Java Simulations (2001- ) => Collaborative Community of EJS => Topic started by: TheMattHatter on January 11, 2012, 11:15:28 am



Title: Primary School remix for Pendulum
Post by: TheMattHatter on January 11, 2012, 11:15:28 am
Primary School remix for Pendulum by MattHatter

reference:

Hi Prof Hwang, this account cannot upload jar files?
the option is not enabled for MattHatter
thanks!

option appears in edit mode but ot first post
for your info

Hi Prof Hwang
the jar cannot be uploaded, strange!


Title: Re: Primary School remix for Pendulum
Post by: lookang on January 11, 2012, 12:55:01 pm
Upload new EJS jar file.
testing for Mat.

didn't work too


anyway the sharing
http://weelookang.blogspot.com/2012/01/sharing-at-s5-cluster-open-source.html


Title: Re: Primary School remix for Pendulum
Post by: Fu-Kwun Hwang on January 15, 2012, 11:55:13 am
I can find your previous uploaded file in the server. However, part of the jar file were not unzip successfully.
Could you please try to upload the jar file again. I will try to find out what might be wrong.


Title: Re: Primary School remix for Pendulum
Post by: lookang on January 15, 2012, 10:15:44 pm
reupload as requested by i cannot change the folder to lookang from the original mathatter

strangely the jar file dint upload the source xml.

i will ask mat when i see him to reload the jar again


Title: Re: Primary School remix for Pendulum
Post by: Fu-Kwun Hwang on January 16, 2012, 01:48:07 pm
I can not find .xml or .ejs from the above jar file( ejs_Pendulumweemat.jar ).

I only found EJSSimulationList.xml

It seems that the jar file was not generate for one particular simulation, but a list of simulations.

I would suggest the user load the original ejs source and re-generate the jar file ,then upload it again.


Title: Re: Primary School remix for Pendulum
Post by: TheMattHatter on January 16, 2012, 03:20:34 pm
jar is recheck to contain the source


Title: Re: Primary School remix for Pendulum (Request for help Prof Fu-Kwun)
Post by: TheMattHatter on January 27, 2012, 10:48:47 am
Hi Prof Fu-Kwun Hwang,

I'd like to share this simulation which I've been working on with Loo Kang. But I need your help to modify the formula/code such that when the wrecking ball hits the building, it stops.

I've designed a lesson around this simulation whereby students play a demolision contractor and are supposed to describe how energy is converted from one form to another when the ball hits the building.

Thank you!


Title: Re: Primary School remix for Pendulum
Post by: Fu-Kwun Hwang on January 27, 2012, 09:33:41 pm
Just modified the code in the event:
Code:
//if (x>-0.18-xbuilding+1.0e-5) return theta; // check y > yground do nothing
//else return 1.0e-5; // y>yground return y when y?yground to the limit of the ground to tolerance
return theta;

And it should work fine. I guest that you have other model in mind (need to be implemented) to take care of the collision.


Title: Re: Primary School remix for Pendulum
Post by: lookang on January 28, 2012, 10:27:44 pm
got it!
thanks for the tip!

 if(Building==true&&theta-thetabuilding>0)return theta-thetabuilding;
 else if(Building==true&&theta-thetabuildingleft<0)return theta-thetabuildingleft;
return 0; // time continues


Title: Re: Primary School remix for Pendulum
Post by: Fu-Kwun Hwang on January 28, 2012, 10:41:27 pm
It is better to change the last line:

 return 0; to return 1; // or something else which is larger than 0 for time continue


Title: Re: Primary School remix for Pendulum
Post by: TheMattHatter on January 30, 2012, 10:09:04 am
Thank you Prof! This is great!


Title: Re: Primary School remix for Pendulum
Post by: TheMattHatter on January 30, 2012, 10:41:01 am
Latest file, please let me know if you'd like to view the lesson built on this app and I'll share the Google site with you. Cheers!