Quiz: Symbolic Math in Python
Main.PythonQuiz17 History
Hide minor edits - Show changes to markup
- Incorrect. The function returns the derivatives at the current time and state values, not the solution.
- Incorrect. Use sp.Symbol('x').
- Incorrect. The user-defined function returns the derivatives at the requested time and state values.
- Incorrect. Use sp.Symbol('x')
- (:toggle hide q3a button show="Select":)
(:div id=q3a:)
- (:toggle hide q4a button show="Select":)
(:div id=q4a:)
- (:toggle hide q3b button show="Select":)
(:div id=q3b:)
- (:toggle hide q4b button show="Select":)
(:div id=q4b:)
(:title Quiz: Symbolic Math in Python:) (:keywords quiz, test, Python, plot, sympy, symbolic, equations, introduction, course:) (:description Learning assessment on symbolic math solutions with Python.:)
1. What are some of the SymPy Python package capabilities for symbolic math operations? Check all that apply.
(:div id=q1a:)
- Correct.
(:divend:)
(:div id=q1b:)
- Correct.
(:divend:)
(:div id=q1c:)
- Correct.
(:divend:)
(:div id=q1d:)
- Correct.
(:divend:)
2. In order to use the symbolic features of SymPy (import sympy as sp), a variable such as x must first be declared as follows (see help video):
(:div id=q2a:)
- Incorrect. The function returns the derivatives at the current time and state values, not the solution.
(:divend:)
(:div id=q2b:)
- Incorrect. The user-defined function returns the derivatives at the requested time and state values.
(:divend:)
(:div id=q2c:)
- Correct.
(:divend:)
3. Analytic solutions are not exact.
(:div id=q3a:)
- Incorrect. Numerical solutions are not exact. Analytic solutions are exact.
(:divend:)
(:div id=q3b:)
- Correct. Numerical solutions are not exact. Analytic solutions are exact.
(:divend:)
4. Numerical solutions are typically an approximation of an exact solution.
(:div id=q3a:)
- Correct. One example is to use a finite difference to calculate a derivative such as df(x)/dx = f(x1)-f(x0) / (x1-x0). As the difference between x1 and x0 decreases, the approximation become more exact until the limits of machine precision (number of decimal places that can be stored by a computer) introduces round-off or truncation error.
(:divend:)
(:div id=q3b:)
- Incorrect. The exact analytic solution is often not possible, but the numeric error can be approximated and reduced to a specified level.
(:divend:)