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.

Function Field post and replies

Return to the Function Field thread
Login to post to this thread

Function Field
Ana Garcia
2 Posts

Is the function field evaluation limited to only 3 variables or am I missing something? Is it possible to evaluate more?
Thanks!


Replies to Function Field

Re: Function Field -
Francisco Esquembre
237 Posts

Hi Ana,

No. You can have an unlimited number of variables. The key point is to call the evaluate method correctly. That is, using an array, such as:

  double value = _view.functionField.evaluate(new double[] {a,b,c,d } );

See the attached example, where I use 4 variables.

Paco

Attached File: ejs_src_FunctionFieldExample.zip



Re: Re: Function Field -
Ana Garcia
2 Posts

Great, thanks for the answer and the example, I got it to work in my own simulation
Thank you



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