cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
LMSteve
Level I

looking for a platform to handle harmonic oscillation

Specifically looking for a curve fitting platform for underdamped oscillation

1 ACCEPTED SOLUTION

Accepted Solutions
vince_faller
Super User (Alumni)

Re: looking for a platform to handle harmonic oscillation

Are you trying to just plot an underdamped oscillator?  Or are you trying to fit beta and w0?  The below script will actually fit. 

 

Names Default to here(1);
dt = New Table("Harmonic Oscillator", 
	New Table Variable("beta", .3),
	New Table Variable("w0", .4),
	New Column("t", set values(0::50)), 
	New Column("Cos t", formula(Cos(t))), 
	New Column("Damped Cos t", Formula(
		exp(-:beta*:w0*:t)*cos(:w0*t) + random normal(0, .01) //just adding noise
	)), 
	New Column("Predictor", 
		Formula(
			Parameter({pbeta = .2, pw0 = .5}, 
				exp(-pbeta*pw0*:t)*cos(pw0*t)
			)
		)
	)
);

dt << Nonlinear( Y( :Damped Cos t ), X( :Predictor ), Newton );

 

To give you this.  notice how my actual beta/w0 was .3/.4 but I started my predictor with .2/.5

3-24-2017 10-56-15 AM.png

 

Is this sort of what your'e looking for?

Vince Faller - Predictum

View solution in original post

6 REPLIES 6
txnelson
Super User

Re: looking for a platform to handle harmonic oscillation

In JMP 13, have you looked at

     Anaylze==>Specialized Modeling==>Fit Curve

Jim
LMSteve
Level I

Re: looking for a platform to handle harmonic oscillation

Hacking through that now - thanks.  My data should create a an exponentially decaying sinusoid.  Trying to figure out how to make JMP do it.

vince_faller
Super User (Alumni)

Re: looking for a platform to handle harmonic oscillation

You can give custom equations and parameters in the nonlinear platform.  Also Under specialized models.  

Vince Faller - Predictum
LMSteve
Level I

Re: looking for a platform to handle harmonic oscillation

Thanks y'all.  I appreciate the suggetions.  I was able to answer my client's question by fitting an exponential decay curve through my data rather than generate the oscillating underdamped plot.  I would like to figure that part out though.  I need to find some examples to learn from.  Thanks again.

vince_faller
Super User (Alumni)

Re: looking for a platform to handle harmonic oscillation

Are you trying to just plot an underdamped oscillator?  Or are you trying to fit beta and w0?  The below script will actually fit. 

 

Names Default to here(1);
dt = New Table("Harmonic Oscillator", 
	New Table Variable("beta", .3),
	New Table Variable("w0", .4),
	New Column("t", set values(0::50)), 
	New Column("Cos t", formula(Cos(t))), 
	New Column("Damped Cos t", Formula(
		exp(-:beta*:w0*:t)*cos(:w0*t) + random normal(0, .01) //just adding noise
	)), 
	New Column("Predictor", 
		Formula(
			Parameter({pbeta = .2, pw0 = .5}, 
				exp(-pbeta*pw0*:t)*cos(pw0*t)
			)
		)
	)
);

dt << Nonlinear( Y( :Damped Cos t ), X( :Predictor ), Newton );

 

To give you this.  notice how my actual beta/w0 was .3/.4 but I started my predictor with .2/.5

3-24-2017 10-56-15 AM.png

 

Is this sort of what your'e looking for?

Vince Faller - Predictum
LMSteve
Level I

Re: looking for a platform to handle harmonic oscillation

Exactly!!!  You hit a grand slam!  Many thanks!!