{"id":463,"date":"2014-06-24T16:36:56","date_gmt":"2014-06-24T13:36:56","guid":{"rendered":"http:\/\/www.sjut.org\/math\/?p=463"},"modified":"2014-06-25T10:08:31","modified_gmt":"2014-06-25T07:08:31","slug":"mat210-2014-06-24","status":"publish","type":"post","link":"http:\/\/www.sjut.org\/math\/index.php\/mat210-2014-06-24\/","title":{"rendered":"MAT210 Workshop June 24 &#038; 25"},"content":{"rendered":"<p>In this workshop, we will use GnuPlot and a spreadsheet to do linear regression and look at some of the analysis parameters.<\/p>\n<p>To run GnuPlot on the web open <a title=\"GnuPlot on the web\" href=\"http:\/\/www.plotshare.com\" target=\"_blank\">http:\/\/www.plotshare.com<\/a>\u00a0 in another browser tab or window.<\/p>\n<p>Note that the plotshare requires you to prove you are human by entering the text presented in the <em>Options<\/em> box just below the main <em>Gnuplot-Script<\/em> box at the top of the page.<\/p>\n<p>Copy \/ paste the script from <strong>Example 6.03.1<\/strong> below into the Gnuplot-Script box on plotshare, then Add external data and copy \/ paste the data after the script into the text box ExtData1.<\/p>\n<p>Click Execute to fit line and plot the end result. That\u2019s all it takes to do regression with Gnuplot.<\/p>\n<p>Replace the script and the data with the information under <strong>Example 6.03.2<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.dropbox.com\/s\/uxc7o3aae81wej6\/Linear%20Regression.xls\" target=\"_blank\">Download the spreadsheet version here<\/a> and <a href=\"https:\/\/www.dropbox.com\/s\/og6u7qy7it8cjq3\/Linear%20Regression.PNG\" target=\"_blank\">a picture explaining the steps to complete the regression in the spreadsheet here<\/a>. A good description of the use of LINEST is provided <a href=\"http:\/\/office.microsoft.com\/en-us\/excel-help\/linest-HP005209155.aspx\" target=\"_blank\">here by Microsoft<\/a>.<\/p>\n<p>For another example, but for a more general least squares fit, look at <a title=\"MAT113 Workshop 23th &amp; 24th June\" href=\"http:\/\/www.sjut.org\/math\/index.php\/mat113-2014-06-23\/\">this MAT113 workshop exercise<\/a>.<\/p>\n<h4>Example 6.03.1<\/h4>\n<h5>Script<\/h5>\n<pre><code>\r\n# === The linear equation ===\r\nT(x) = k1 + k2 * x\r\n# === The regression command ===\r\nfit T(x) 'ExtData1' via k1, k2\r\n# === Plotting with nice formatting ===\r\nset key inside bottom right title 'Legend' box 3\r\nset xlabel 'Angle, radians'\r\nset ylabel 'Torque, N-m'\r\nset xrange [0.5:2.0]\r\nset yrange [0.1:0.4]\r\nset linetype 1 lw 2 lc rgb \"blue\" pointtype 6\r\nset linetype 2 lw 2 lc rgb \"forest-green\" pointtype 8\r\nplot T(x) title 'Torque line', 'ExtData1' title 'Torque data'\r\n<\/code><\/pre>\n<h5>ExtData1<\/h5>\n<pre><code>\r\n# Angle,  Torque\r\n#Radians, N-m\u00b7\r\n0.698132  0.188224\r\n0.959931  0.209138\r\n1.134464  0.230052\r\n1.570796  0.250965\r\n1.919862  0.313707\r\n<\/code><\/pre>\n<h4>Example 6.03.2<\/h4>\n<h5>Script<\/h5>\n<pre><code>\r\n# === The linear equation ===\r\nS(x) = E * x\r\n# === The regression command ===\r\nfit S(x) 'ExtData1' via E\r\n# === Plotting with nice formatting ===\r\nset key inside bottom right title 'Legend' box 3\r\nset xlabel 'Strain (%)'\r\nset ylabel 'Stess (MPa)'\r\nset xrange [0:1.6]\r\nset yrange [0:3000]\r\nplot S(x) title 'Modulus line', 'ExtData1' title 'Strain data'\r\n<\/code><\/pre>\n<h5>ExtData1<\/h5>\n<pre><code>\r\n# epsilon sigma\r\n0  0\r\n0.183  306\r\n0.36  612\r\n0.5324 917\r\n0.702  1223\r\n0.867  1529\r\n1.0244 1835\r\n1.1774 2140\r\n1.329  2446\r\n1.479  2752\r\n1.5  2767\r\n1.56  2896\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this workshop, we will use GnuPlot and a spreadsheet to do linear regression and look at some of the analysis parameters. To run GnuPlot on the web open http:\/\/www.plotshare.com\u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.sjut.org\/math\/index.php\/wp-json\/wp\/v2\/posts\/463"}],"collection":[{"href":"http:\/\/www.sjut.org\/math\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sjut.org\/math\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sjut.org\/math\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sjut.org\/math\/index.php\/wp-json\/wp\/v2\/comments?post=463"}],"version-history":[{"count":6,"href":"http:\/\/www.sjut.org\/math\/index.php\/wp-json\/wp\/v2\/posts\/463\/revisions"}],"predecessor-version":[{"id":469,"href":"http:\/\/www.sjut.org\/math\/index.php\/wp-json\/wp\/v2\/posts\/463\/revisions\/469"}],"wp:attachment":[{"href":"http:\/\/www.sjut.org\/math\/index.php\/wp-json\/wp\/v2\/media?parent=463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sjut.org\/math\/index.php\/wp-json\/wp\/v2\/categories?post=463"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sjut.org\/math\/index.php\/wp-json\/wp\/v2\/tags?post=463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}