Pages

Sunday, September 22, 2013

how to create JavaScript EJS models

how to create JavaScript EJS models?

Assuming you already know a bit about EJS 4.3.7 this tutorial aims to introduce some of the key features as unveil during MPTL18 by Professor Paco, creator of Easy Java Simulation, an authoring tool-kit for physics models.



  1. after launching EJS console.jar, select Programming language to Javascript instead of Java
    Javascript
  2. a new authoring environment will be launched that looks pretty much similar except with the obvious difference of the HtmlView 
    EJS5.0 Beta with Javascript authoring environment 
  3. since this is a beta, but it is pretty compete with the usual radio buttons like Description, Model and HtmlView. Users of EJS 4.3.7 used to Java will have to reprogram the codes into their new Javascript model. ( Yes, there is currently no automatic cross conversion of sort, authors need to recreate their new models in the new environment ( copy and paste only works between Javascript models, and not between Java and Javascripts models)
  4. There are some useful examples already available in the comPadre Library, to get to the library click on the "Read from an EJS library icon" just below the save, save as and search icon.
    Read from an EJS library icon
  5. Click on the Get Catalog and search for "ejss" as a search keyword and all the EJSS models will be available for download and you can copy and paste some of the elements and codes ( with modification ) into your own fresh model that you want to recreate.
    search for "ejss" 
  6. click on any of the models that you wish to examine to learn how to program, click on the download
    comPadre digital EJSS models listed
  7. EJSS will prompt you to save the model, i recommend saving it into a new folder "EJSS" where i choose to keep all EJSS models, fundamentally they are different and currently do not require saving into the users/sgeducation/lookang folder.
    save into your source folder
  8. click on the compile or run model button 
    ferrisWheelJS model by professor mario

  9. and EJSS will take care of the rest and run in a emulator
    EJSS emulator view
  10. i manage to create a simpler model that EJSS currently seems to be able to generate here http://weelookang.blogspot.sg/2013/09/one-dimension-collision-js-model.html


    One Dimension Collision JS Model
    author: lookang
    Online: https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejss_model_Momentum1D01/Momentum1D01_Simulation.html
    Download: https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejss_model_Momentum1D01.zip


  11. click on the dropbox link and enjoy!
  12. there is a lot to play with and great potential to introduce students to make physics models :)

No comments:

Post a Comment