Difference between revisions of "EGR 103/Fall 2018/Lab 7"

From PrattWiki
Jump to navigation Jump to search
 
 
(One intermediate revision by the same user not shown)
Line 15: Line 15:
 
* See [[Python:Fitting#General_Linear_Regression]]
 
* See [[Python:Fitting#General_Linear_Regression]]
 
* Whenever you have values on an axis that makes the axis numbers take up more space that they should, you can tell Python to use scientific notation on that axis.  For this code, you will want to use scientific notation on the y axis; you can do this with the code:
 
* Whenever you have values on an axis that makes the axis numbers take up more space that they should, you can tell Python to use scientific notation on that axis.  For this code, you will want to use scientific notation on the y axis; you can do this with the code:
<syntaxhighlight lang='python'>
+
:<syntaxhighlight lang='python'>
 
plt.ticklabel_format(axis='y', style='sci', scilimits=(0, 0))
 
plt.ticklabel_format(axis='y', style='sci', scilimits=(0, 0))
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 38: Line 38:
 
* This is another one where the tick labels might be best in scientific notation.
 
* This is another one where the tick labels might be best in scientific notation.
 
* For <code>np.logspace()</code>, note that the first and second arguments are the powers of ten to use in the range, not the values.  That is:
 
* For <code>np.logspace()</code>, note that the first and second arguments are the powers of ten to use in the range, not the values.  That is:
<syntaxhighlight lang='python'>
+
:<syntaxhighlight lang='python'>
 
np.logspace(1, 3, 5)
 
np.logspace(1, 3, 5)
 
</syntaxhighlight>
 
</syntaxhighlight>
will give:
+
:will give:
<syntaxhighlight language='python'>
+
:<syntaxhighlight language='python'>
 
array([  10., 31.62,  100., 316.23, 1000.])
 
array([  10., 31.62,  100., 316.23, 1000.])
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== General Concepts ==
 
== General Concepts ==

Latest revision as of 04:43, 30 October 2018

The following document is meant as an outline of what is covered in this assignment.

Typographical Errors

None yet!

Specific Problems

  • Note in the skeleton that code is already given to bring in the files and figures. If you use different names, just change the names in the skeleton.
  • Be sure to put the appropriate version of the honor code -- if you use the examples from Pundit, the original author is either DukeEgr93 or Michael R. Gustafson II depending on how you want to cite things.

Chapra 14.5

  • See Python:Fitting#Polynomial_Fitting
  • Be sure to also calculate and report \(s_{y/x}\) and \(r\), along with the \(S_t\), \(S_r\), and \(r^2\) values you have to report for every problem.

Chapra 14.7

  • See Python:Fitting#General_Linear_Regression
  • Whenever you have values on an axis that makes the axis numbers take up more space that they should, you can tell Python to use scientific notation on that axis. For this code, you will want to use scientific notation on the y axis; you can do this with the code:
plt.ticklabel_format(axis='y', style='sci', scilimits=(0, 0))
  • Be sure to calculate, report, and discuss the R value. It is not the same as the slope of the line.

Chapra 14.7

Chapra 15.10 and

Chapra 15.10 Alternate

Chapra 15.11

  • See Python:Fitting#Nonlinear_Regression
  • For the initial guesses, make sure you understand the subscripts for the parameters and then figure out how to approximate their values from the information provided in the problem.

Chapra 15.14(b)

  • See Python:Fitting#Nonlinear_Regression
  • This is another one where the tick labels might be best in scientific notation.
  • For np.logspace(), note that the first and second arguments are the powers of ten to use in the range, not the values. That is:
np.logspace(1, 3, 5)
will give:
array([  10., 31.62,  100., 316.23, 1000.])

General Concepts