DOC PREVIEW
CSU MECH 102 - Linearized Regression Example

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Linearized Regression Examplefitting a theoretical function to experimental stress-strain dataProvided experimental data:≔σT2250 3575 4250 4350 4250[[]]≔εT⋅500 10−6⋅1000 10−6⋅1500 10−6⋅2000 10−6⋅2375 10−6⎡⎣⎤⎦≔n length((ε))=n 5≔i ‥0−n 1Theoretical nonlinear function to be fit with linearized regression:=σ ⋅⋅aεe⋅−bεTaking the natural log of both sides:=ln((σ))−+ln((a))ln((ε))⋅bε=−ln((σ))ln((ε))−ln((a))⋅bε=ln⎛⎜⎝―σε⎞⎟⎠−ln((a))⋅bε=Y +a0⋅a1X≔Xiεi≔Yiln⎛⎜⎜⎜⎝―σiεi⎞⎟⎟⎟⎠≔a1slope((,XY))=a1−492.333≔a0intercept((,XY))=a015.577≔aa0=a ⋅5.823 106≔b −a1=b 492.333Cihdd dli ffiiNon-Commercial Use OnlyComputing the standard error and correlation coefficient:≔xε ≔yσ ≔f((x))⋅⋅ax⋅−bx≔x_bar――∑ixin=x_bar 0.001 ≔y_bar――∑iyin=y_bar ⋅3.735 103≔St∑i⎛⎝−yiy_bar⎞⎠2=St⋅3.14 106≔Sr∑i⎛⎝−yif⎛⎝xi⎞⎠⎞⎠2=Sr⋅8.815 103≔sy_x‾‾‾‾‾――Sr−n 2=sy_x54.205≔r‾‾‾‾‾‾―――−StSrSt=r 0.9986Plotting the results:≔xmin0≔xmaxmax((x))≔Δx――――−xmaxxmin100≔xf ,‥xmin+xminΔx xmax9001.35⋅10³1.8⋅10³2.25⋅10³2.7⋅10³3.15⋅10³3.6⋅10³4.05⋅10³04504.5⋅10³5⋅10⁻⁴ 7.5⋅10⁻⁴ 0.001 0.001 0.002 0.002 0.002 0.0020 2.5⋅10⁻⁴ 0.003yif((xf))xixfNon-Commercial Use OnlyA better alternative to fitting the linearized equation is to use MathCad to do a nonlinear fit directly, using numerical optimization:Define the data vectors:≔vx =ε⋅510−40.0010.0020.0020.002⎡⎢⎢⎢⎢⎢⎣⎤⎥⎥⎥⎥⎥⎦≔vy =σ⋅2.25 103⋅3.575 103⋅4.25 103⋅4.35 103⋅4.25 103⎡⎢⎢⎢⎢⎢⎣⎤⎥⎥⎥⎥⎥⎦Define the function using a vector of unknown parameters:=σ ⋅⋅aεe⋅−bε≔F((,xa))⋅⋅a0x⋅−a1xDefine initial guesses for the function parameters:=guessa0a1⎡⎢⎢⎣⎤⎥⎥⎦≔guess100000100⎡⎢⎣⎤⎥⎦Have MathCAD solve for the optimal function parameters to fit the data:≔a =genfit((,,,vx vy guess F))⋅5.898 106498.933⎡⎢⎣⎤⎥⎦≔fg((x))F((,xa))Calculate the correlation coefficient:≔fitifg⎛⎝vxi⎞⎠=corr((,fit vy))0.9992Non-Commercial Use OnlyComparing the results:9001.35⋅10³1.8⋅10³2.25⋅10³2.7⋅10³3.15⋅10³3.6⋅10³4.05⋅10³04504.5⋅10³5⋅10⁻⁴ 7.5⋅10⁻⁴ 0.001 0.001 0.002 0.002 0.002 0.0020 2.5⋅10⁻⁴ 0.003yif((xf))fg((xf))xixf xfNon-Commercial Use


View Full Document

CSU MECH 102 - Linearized Regression Example

Download Linearized Regression Example
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Linearized Regression Example and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Linearized Regression Example 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?