phy lab 1

30
ZunZun.com Physicist Peter's Custom Equation Equation Family: Miscellaneous y = A + B*(X-C) + 0.5*G*(X-C)**2 Wed Feb 5 17:00:58 2014 local server time Page 1 of 30 http://zunzun.com

Upload: calvin-cheng

Post on 01-Feb-2016

213 views

Category:

Documents


0 download

DESCRIPTION

y = A + B*(X-C) + 0.5*G*(X-C)**2

TRANSCRIPT

Page 1: phy lab 1

ZunZun.com

Physicist Peter's Custom Equation

Equation Family: Miscellaneous

y = A + B*(X-C) + 0.5*G*(X-C)**2

Wed Feb 5 17:00:58 2014 local server time

Page 1 of 30http://zunzun.com

Page 2: phy lab 1

Mark 6:53-56

And when they had passed over, they came into the land of Gennesaret, and drew to the shore. Andwhen they were come out of the ship, straightway they knew him, And ran through that whole regionround about, and began to carry about in beds those that were sick, where they heard he was. And

whithersoever he entered, into villages, or cities, or country, they laid the sick in the streets, andbesought him that they might touch if it were but the border of his garment: and as many as touched

him were made whole.

Read or search the King James Bible online athttp://quod.lib.umich.edu/k/kjv/

Page 2 of 30http://zunzun.com

Page 3: phy lab 1

Coefficients

y = A + B*(X-C) + 0.5*G*(X-C)**2

Fitting target of lowest sum of squared absolute error = 3.5375377442728176E-06

A = 4.4802945381686374E-02

B = 9.1759653506420780E-01

C = 0.0000000000000000E+00

G = 9.6094939267681241E+00

Page 3 of 30http://zunzun.com

Page 4: phy lab 1

Coefficient and Fit Statistics

Most statstics from scipy.odr.odrpack and http://www.scipy.org/Cookbook/OLS

LL, AIC and BIC from http://stackoverflow.com/questions/7458391/python-multiple-linear-regression-us

ing-ols-code-with-specific-data

Degrees of freedom (error): 10

Degrees of freedom (regression): 3

Chi-squared: 3.53753774427e-06

R-squared: 0.99995721381

R-squared adjusted: 0.999944377953

Model F-statistic: 77903.4248532

Model F-statistic p-value: 1.11022302463e-16

Model log-likelihood: 86.4728192195

AIC: -11.7818313171

BIC: -11.5992435086

Root Mean Squared Error (RMSE): 0.000502674116549

A = 4.4802945381686374E-02

std err squared: 1.97121E-07

t-stat: 1.00911E+02

p-stat: 2.22045E-16

95% confidence intervals: [4.38137E-02, 4.57922E-02]

B = 9.1759653506420780E-01

std err squared: 1.60251E-04

t-stat: 7.24855E+01

p-stat: 6.21725E-15

95% confidence intervals: [8.89390E-01, 9.45803E-01]

C = 0.0000000000000000E+00

std err squared: 0.00000E+00

t-stat: NAN

p-stat: NAN

95% confidence intervals: [0.00000E+00, 0.00000E+00]

G = 9.6094939267681241E+00

std err squared: 2.46098E-02

t-stat: 6.12557E+01

p-stat: 3.26406E-14

95% confidence intervals: [9.25995E+00, 9.95903E+00]

Coefficient Covariance Matrix

[ 0.61294855 -14.57252165 0. 149.73683951]

[ -14.57252165 498.30241139 0. -5960.28894189]

[ 0. 0. 0. 0.]

[ 149.73683951 -5960.28894189 0. 76524.43521256]

Page 4 of 30http://zunzun.com

Page 5: phy lab 1

Error Listing

Independent Data Dependent Data Predicted Abs Error Rel Error

0.000E+00 4.450E-02 4.4802945382E-02 3.029454E-04 6.807761E-03

1.790E-02 6.300E-02 6.2767412334E-02 -2.325877E-04 -3.691868E-03

3.480E-02 8.300E-02 8.2554045564E-02 -4.459544E-04 -5.372945E-03

4.890E-02 1.010E-01 1.0116257493E-01 1.625749E-04 1.609653E-03

6.270E-02 1.210E-01 1.2122510182E-01 2.251018E-04 1.860346E-03

7.410E-02 1.395E-01 1.3917880130E-01 -3.211987E-04 -2.302500E-03

8.630E-02 1.590E-01 1.5977579227E-01 7.757923E-04 4.879197E-03

9.600E-02 1.778E-01 1.7717276076E-01 -6.272392E-04 -3.527780E-03

1.067E-01 1.970E-01 1.9741201133E-01 4.120113E-04 2.091428E-03

1.156E-01 2.155E-01 2.1508466822E-01 -4.153318E-04 -1.927294E-03

1.256E-01 2.358E-01 2.3584968324E-01 4.968324E-05 2.107008E-04

1.339E-01 2.540E-01 2.5381443873E-01 -1.855613E-04 -7.305562E-04

1.429E-01 2.730E-01 2.7404239318E-01 1.042393E-03 3.818290E-03

1.503E-01 2.920E-01 2.9125737093E-01 -7.426291E-04 -2.543250E-03

Page 5 of 30http://zunzun.com

Page 6: phy lab 1

Error Statistics

Absolute Error Relative Error

Minimum: -7.426291E-04 -5.372945E-03

Maximum: 1.042393E-03 6.807761E-03

Mean: -1.349853E-13 8.437023E-05

Std. Error of Mean: 1.394167E-04 9.552160E-04

Median: -6.793901E-05 -2.599277E-04

Variance: 2.526813E-07 1.186169E-05

Standard Deviation: 5.026741E-04 3.444080E-03

Skew: 4.748285E-01 3.138847E-01

Kurtosis: -6.211260E-01 -8.904169E-01

Page 6 of 30http://zunzun.com

Page 7: phy lab 1

Data Statistics

X Y

Minimum: 0.000000E+00 4.450000E-02

Maximum: 1.503000E-01 2.920000E-01

Mean: 8.540714E-02 1.682929E-01

Std. Error of Mean: 1.269906E-02 2.131391E-02

Median: 9.115000E-02 1.684000E-01

Variance: 2.096461E-03 5.905674E-03

Standard Deviation: 4.578712E-02 7.684838E-02

Skew: -3.284659E-01 -1.894040E-03

Kurtosis: -1.042620E+00 -1.214823E+00

Page 7 of 30http://zunzun.com

Page 8: phy lab 1

Source Code in C++

// To the best of my knowledge this code is correct.

// If you find any errors or problems please contact

// me directly using [email protected].

//

// James

#include <math.h>

// Fitting target: lowest sum of squared absolute error

// Fitting target value = 3.53753774427e-06

double Miscellaneous_PhysicistPeterCustomEquation_model(double x_in)

{

double temp;

temp = 0.0;

// coefficients

double A = 4.4802945381686374E-02;

double B = 9.1759653506420780E-01;

double C = 0.0000000000000000E+00;

double G = 9.6094939267681241E+00;

temp = A + B*(x_in-C) + 0.5*G*pow(x_in-C, 2.0);

return temp;

}

Page 8 of 30http://zunzun.com

Page 9: phy lab 1

Source Code in Java

// To the best of my knowledge this code is correct.

// If you find any errors or problems please contact

// me directly using [email protected].

//

// James

import java.lang.Math;

// Fitting target: lowest sum of squared absolute error

// Fitting target value = 3.53753774427e-06

class Miscellaneous_PhysicistPeterCustomEquation

{

double Miscellaneous_PhysicistPeterCustomEquation_model(double x_in)

{

double temp;

temp = 0.0;

// coefficients

double A = 4.4802945381686374E-02;

double B = 9.1759653506420780E-01;

double C = 0.0000000000000000E+00;

double G = 9.6094939267681241E+00;

temp = A + B*(x_in-C) + 0.5*G*Math.pow(x_in-C, 2.0);

return temp;

}

}

Page 9 of 30http://zunzun.com

Page 10: phy lab 1

Source Code in JavaScript

// To the best of my knowledge this code is correct.

// If you find any errors or problems please contact

// me directly using [email protected].

//

// James

// Fitting target: lowest sum of squared absolute error

// Fitting target value = 3.53753774427e-06

function Miscellaneous_PhysicistPeterCustomEquation_model(x_in)

{

var temp;

temp = 0.0;

// coefficients

var A = 4.4802945381686374E-02;

var B = 9.1759653506420780E-01;

var C = 0.0000000000000000E+00;

var G = 9.6094939267681241E+00;

temp = A + B*(x_in-C) + 0.5*G*Math.pow(x_in-C, 2.0);

return temp;

}

Page 10 of 30http://zunzun.com

Page 11: phy lab 1

Source Code in Python

# To the best of my knowledge this code is correct.

# If you find any errors or problems please contact

# me directly using [email protected].

#

# James

import math

# Fitting target: lowest sum of squared absolute error

# Fitting target value = 3.53753774427e-06

def Miscellaneous_PhysicistPeterCustomEquation_model(x_in):

temp = 0.0

# coefficients

A = 4.4802945381686374E-02

B = 9.1759653506420780E-01

C = 0.0000000000000000E+00

G = 9.6094939267681241E+00

temp = A + B*(x_in-C) + 0.5*G*math.pow(x_in-C, 2.0)

return temp

Page 11 of 30http://zunzun.com

Page 12: phy lab 1

Source Code in C#

// To the best of my knowledge this code is correct.

// If you find any errors or problems please contact

// me directly using [email protected].

//

// James

using System;

// Fitting target: lowest sum of squared absolute error

// Fitting target value = 3.53753774427e-06

class Miscellaneous_PhysicistPeterCustomEquation

{

double Miscellaneous_PhysicistPeterCustomEquation_model(double x_in)

{

double temp;

temp = 0.0;

// coefficients

double A = 4.4802945381686374E-02;

double B = 9.1759653506420780E-01;

double C = 0.0000000000000000E+00;

double G = 9.6094939267681241E+00;

temp = A + B*(x_in-C) + 0.5*G*Math.Pow(x_in-C, 2.0);

return temp;

}

}

Page 12 of 30http://zunzun.com

Page 13: phy lab 1

Source Code in SCILAB

// To the best of my knowledge this code is correct.

// If you find any errors or problems please contact

// me directly using [email protected].

//

// James

// Fitting target: lowest sum of squared absolute error

// Fitting target value = 3.53753774427e-06

function y = Miscellaneous_PhysicistPeterCustomEquation_model(x_in)

temp = 0.0;

// coefficients

A = 4.4802945381686374E-02;

B = 9.1759653506420780E-01;

C = 0.0000000000000000E+00;

G = 9.6094939267681241E+00;

temp = A + B*(x_in-C) + 0.5*G*power(x_in-C, 2.0);

y = temp;

endfunction

Page 13 of 30http://zunzun.com

Page 14: phy lab 1

Source Code in MATLAB

% To the best of my knowledge this code is correct.

% If you find any errors or problems please contact

% me directly using [email protected].

%

% James

% Fitting target: lowest sum of squared absolute error

% Fitting target value = 3.53753774427e-06

function y = Miscellaneous_PhysicistPeterCustomEquation_model(x_in)

temp = 0.0;

% coefficients

A = 4.4802945381686374E-02;

B = 9.1759653506420780E-01;

C = 0.0000000000000000E+00;

G = 9.6094939267681241E+00;

temp = A + B.*(x_in-C) + 0.5.*G.*power(x_in-C, 2.0);

y = temp;

Page 14 of 30http://zunzun.com

Page 15: phy lab 1

Source Code in VBA

' To the best of my knowledge this code is correct.

' If you find any errors or problems please contact

' me directly using [email protected].

'

' James

' Fitting target: lowest sum of squared absolute error

' Fitting target value = 3.53753774427e-06

Public Function Miscellaneous_PhysicistPeterCustomEquation_model(x_in)

temp = 0.0

' coefficients

Const A = 4.4802945381686374E-02

Const B = 9.1759653506420780E-01

Const C = 0.0000000000000000E+00

Const G = 9.6094939267681241E+00

temp = A + B*(x_in-C) + 0.5*G*Application.WorksheetFunction.power(x_in-C, 2.0)

Miscellaneous_PhysicistPeterCustomEquation_model = temp

End Function

Page 15 of 30http://zunzun.com

Page 16: phy lab 1

Histogram of shifted time T (seconds)

Page 16 of 30http://zunzun.com

Page 17: phy lab 1

Histogram of coordinate Y (meters)

Page 17 of 30http://zunzun.com

Page 18: phy lab 1

Histogram of Absolute Error

Page 18 of 30http://zunzun.com

Page 19: phy lab 1

Histogram of Relative Error

Page 19 of 30http://zunzun.com

Page 20: phy lab 1

Histogram of Percent Error

Page 20 of 30http://zunzun.com

Page 21: phy lab 1

Absolute Error vs. shifted time T (seconds)

Page 21 of 30http://zunzun.com

Page 22: phy lab 1

Absolute Error vs. coordinate Y (meters)

Page 22 of 30http://zunzun.com

Page 23: phy lab 1

Relative Error vs. shifted time T (seconds)

Page 23 of 30http://zunzun.com

Page 24: phy lab 1

Relative Error vs. coordinate Y (meters)

Page 24 of 30http://zunzun.com

Page 25: phy lab 1

Percent Error vs. shifted time T (seconds)

Page 25 of 30http://zunzun.com

Page 26: phy lab 1

Percent Error vs. coordinate Y (meters)

Page 26 of 30http://zunzun.com

Page 27: phy lab 1

coordinate Y (meters) vs. shifted time T (seconds)

Page 27 of 30http://zunzun.com

Page 28: phy lab 1

shifted time T (seconds) vs. coordinate Y (meters)

Page 28 of 30http://zunzun.com

Page 29: phy lab 1

coordinate Y (meters) vs. shifted time T (seconds) with model

Page 29 of 30http://zunzun.com

Page 30: phy lab 1

coordinate Y (meters) vs. shifted time T (seconds) with 95% confidence intervals

Page 30 of 30http://zunzun.com