Open Educational Resources

Python Lab Tutorials: Lab 8

In order to noninvasively assess the stability of medical implants, Westover et al. devised a technique by which the implant is struck using a hand-piece while measuring the acceleration response.


In order to assess the stability, the acceleration (a) data as a function of time (t) has to be fit to a model of the form:


where y(t) is the position, a(t) is the acceleration, a_1, a_2, a_3, a_4, a_5, \phi_1, and \phi_2 are the model parameters. Initial guesses for the model parameters can be taken as: 0, 5000, 0, 0, 80000, 0.1, 0.1 respectively.
The following text file OneStrike.txt contains the acceleration data collected by striking one of the implants. Download the data file and use Scipy’s built-in “curve_fit” function to calculate the parameters for the best-fit model along with the value of R^2. Plot the data overlapping the model.

Hint: for “curve_fit", set p0=[...] to pass initial guesses and set max iterations to 10,000: maxfev=10000

Reference: L. Westover, W. Hodgetts, G. Faulkner, D. Raboud. 2015. Advanced System for Implant Stability Testing (ASIST). OSSEO 2015 5th International Congress on Bone Conduction Hearing and Related Technologies, Fairmont Chateau Lake Louise, Canada, May 20 – 23, 2015.

Video Tutorials

Importing data from text files

Curve Fitting using Scipy

Leave a Reply

Your email address will not be published.