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.

Stepwise Functions post and replies

Return to the Stepwise Functions thread
Login to post to this thread

Defining a function by steps
Rodolfo F
1 Posts

What I'm basically trying to do is make a function that can read and operate object data on individual steps. Say for example I want to calculate velocity: one way to do it is to take the position of the object at a time t, and substract it from the position at a time t+1, and divide it by the difference between t and t+1. Is it possible to do this with Tracker?


Replies to Defining a function by steps

Re: Defining a function by steps -
Douglas Brown Avatar
Douglas Brown
450 Posts

No. You can define data functions that depend on multiple columns in a data table: the variables are the column names. But functions are evaluated at each time using values from the same (time) row.  Doug



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