Education Prize Logo
Science SPORE Prize
November 2011

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

How to use myFunction.evaluate

Return to the EJS Modeling forum
Login to post to this thread

How to use myFunction.evaluate - Dec 12, 2016 at 3:25PM
Mirka Kouka
3 Posts

Hello,

I have in my simulation 3 fields. The first one has the function (for example 4*sin(pi/8*x)) but it can change from the user. The second one has the x-value of the function which also could be defined by the user. The third one is not editable and should show the value of the function.

By the initialization page when I write fx = _view.functionField.evaluate({x:1}); I get the correct result for x=1 but I want to get a result for any x given by the user in the second field.

I have tried  fx = _view.functionField.evaluate({x:_view.xField}); (xField is the name of my 2nd field) but it doesn't work.

Can anyone help me make this working? Thank you!!!!


Current Replies - View all
Re: How to use myFunction...   (Wolfgang - Dec 12, 2016 at 5:26PM)
Re: Re: How to use myFunc...   (Mirka Kouka - Dec 13, 2016 at 5:45PM)
Re: Re: Re: How to use my...   (Wolfgang - Dec 14, 2016 at 7:51AM)
Re: Re: Re: Re: How to us...   (Mirka Kouka - Dec 14, 2016 at 9:26AM)
The OSP Network:
Open Source Physics - Tracker - EJS Modeling
Physlet Physics
Physlet Quantum Physics