APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

How to invoke ejss library for analytical solution for derivatives post and replies

Return to the How to invoke ejss library for analytical solution for derivatives thread
Login to post to this thread

How to invoke ejss library for analytical solution for derivatives?
lookang Avatar
lookang
245 Posts

Hi prof Paco and Wolfgang,

How to invoke ejss library for analytical solution for derivatives?

I am trying to re create tracker's modeling capability for analytical solutions.

For example if analytical function is
X= At^2 + Bt +C

The derivative would be
Velocity= 2Ax + B

And again
Acceleration= 2A

My source code is here
http://iwant2study.org/ospsg/index.php/interactive-resources/physics/02-newtonian-mechanics/01-kinematics/38-kinematics-1d

Thank you.


OSP@SG blog
OSP@SG Digital Library

Replies to How to invoke ejss library for analytical solution for derivatives?

Re: How to invoke ejss library for analytical solution for derivatives? -
Wolfgang
192 Posts

Computing symbolic derivates using a mathematical function expressed as a string requires computer (symbolic) algebra capabilities and EjsS does not support computer algebra.  It is, however, not difficult to import an external jar file file (when creating Java programs) or a JavaScript library into EjsS if you find a code library that has features not included in EjsS.  Add that library to the User File field in the Information Dialog to include it in the compiled package.



Re: Re: How to invoke ejss library for analytical solution for derivatives? -
lookang Avatar
lookang
245 Posts

Dear Prof Wolfgang,

thank you for the reply.

i google and found this

https://dev.geogebra.org/trac/wiki/SourcesForUsedLibraries

it is a GeoGebra used Library, and i know GeoGeBra has the computer (symbolic) algebra capabilities that i wish to inject into my EJSS simulations.

is there an example of usage of external JavaScript Libraries on OSP yet so that i can try to figure out how to add code library!

thanks!

my attempt to test it on GeoGebra
http://www.geogebra.org/material/simple/id/2493795

Attached File: geogebraderivatives.png


OSP@SG blog
OSP@SG Digital Library


Re: Re: Re: How to invoke ejss library for analytical solution for derivatives? -
Wolfgang
192 Posts

The Bound Eigenstate Superposition JavaScript model imports three JavaScript files to compute harmonic oscillator wave functions using Hermite polynomials.  These files are in the jslib subdirectory of the source code archive for the following model.

http://www.compadre.org/osp/items/detail.cfm?ID=13742

Attached File: ImportJS.jpg



OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book