Be the first to rate this file! 4 Downloads (last 30 days) File Size: 2.25 KB File ID: #35015

fitting critically damped simple harmonic oscillator

by

 

Four-parameter fit to the equation A*(1 + t/T2).*exp(-t/T1) + offset

| Watch this File

File Information
Description

 [A, T1, T2, offset, Ssq] = fit_critical_damping( t, y, options )
 fitting critically damped oscillations to the equation
 y(t) = A (1 + t/T2) exp( -t/T1 ) + offset
 where A is the amplitude, T1 is a time constant, T2 is the decay time, along with
 the offest. Ssq is the sum of residuals (i.e. fitting error).
 
 options are 'notify' to show progress and 'plot' to give a plot
 you can also supply a guess or series of guesses via a row vector or
 matrix, m, where size( m, 2 ) = 4 (i.e. there are four columns);
 
 if you just run program without arguments it will do an example
 
 examples are
 fit_critical_damping( t, y, 'notify', 'plot')
 [A, T1, T2, offset, Ssq] = fit_critical_damping( t, y, [1 2 3 4] )
 
 Note: this script uses LMFnlsq from MATLAB central file exchange
 sak@wpi.edu 2/8/12

MATLAB release MATLAB 6.5 (R13)
Other requirements this program uses LMFnlsq, which is downloadable from MATLAB central file exchange
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us