Looks like no one added any tags here yet for you.
Is Python free to use?
Yes, Python is open-source software and free to use.
Is Python 2 still in use?
No, Python 2 has been officially retired. Most environments now use Python 3.
Can Python run on different operating systems?
Yes, Python is cross-platform and can run on Windows, macOS, and Linux.
What is the smallest increment that a regular Python float can represent?
Approximately 2.2 x 10^-16, known as machine epsilon for floating point arithmetic.
What is round-off error?
The error caused by approximating a number due to the finite precision of its representation.
What happens when you add 1.0 and 1e-17 in Python?
It returns 1.0 due to the precision limits of floating point arithmetic.
Name two root finding algorithms.
Newton Raphson Method and Bisection Method.
Are NumPy arrays the same as Python lists?
No, NumPy arrays are homogeneous and provide more functionality for numerical operations.
Can you store different data types within a NumPy array?
No, NumPy arrays are homogeneous; all elements must be of the same data type.
How to write ln(2^4) in Python NumPy syntax?
import numpy as np; result = np.log(2**4).
How to write log(10^-3) in Python NumPy syntax?
import numpy as np; result = np.log10(10**-3).
What do the three arguments of np.arange() represent?
Start value, stop value (exclusive), and step size.
What do the three arguments of np.linspace() represent?
Start value, stop value (inclusive), and number of samples.
What is the first element of np.arange(11,2,-2)?
What is the last element of np.arange(11,2,-2)?
What is the first element of np.linspace(2,15,20)?
2.0.
What is the last element of np.linspace(2,15,20)?
15.0.
Name three numerical differentiation methods.
Forward difference, Backward difference, Central difference.
What is the forward difference approximation?
(f(x + h) - f(x)) / h.
What is the backward difference approximation?
(f(x) - f(x - h)) / h.
What is the central difference approximation?
(f(x + h) - f(x - h)) / (2 * h).
What point do you lose with forward difference?
The last point.
What point do you lose with backward difference?
The first point.
What points do you lose with central difference?
The first and last points.
Name four numerical methods for solving ODEs.
Euler’s method, Runge-kutta methods, Adams-Bashforth methods, Finite difference methods.
What is the difference between numerical differentiation methods and numerical methods for solving ODEs?
Numerical differentiation approximates derivatives, while numerical ODE methods find the solution function.
When solving ODEs numerically, are we given the ODEs?
Yes, the ODE must be known to solve it numerically.
Are initial values typically given when solving ODEs numerically?
Yes.
What is the goal of solving an ODE numerically?
To approximate the function that solves the ODE.
Define forward Euler’s method.
Explicitly updates the dependent variable using the function value at the current point.
Define backward Euler’s method.
Requires solving an implicit equation for the dependent variable at the next step.
What is the advantage of forward Euler’s method?
It provides an explicit update equation, making it easier to implement.
What is the disadvantage of backward Euler’s method?
It is more computationally expensive due to solving an implicit equation.
What is the difference between explicit and implicit methods?
Explicit methods use known quantities for the next value, while implicit methods involve solving an equation.
Which methods are explicit and which are implicit?
Forward Euler: explicit; Backward Euler: implicit; Midpoint: explicit; RK4: explicit.
What are the steps to rewrite a higher-order ODE into a system of first-order ODEs?
Define new variables for each derivative. 2. Rewrite the original ODE. 3. Write the system in matrix form. 4. Solve using numerical methods.
How many auxiliary variables are needed to rewrite a nth order ODE?
n-1 auxiliary variables.
Can you use forward Euler’s method with a system of first-order ODEs?
Yes.
What are the four key parameters of scipy.integrate.solve_ivp()?
Fun: function to evaluate the derivative; t_span: interval of integration; y0: initial conditions; method: integration method.
Define absolute error.
The absolute difference between the true value and the approximate value.
Define relative error.
The absolute error divided by the absolute value of the true value.
Define sum of squared error.
The sum of the squares of the differences between true values and approximations.
Define mean squared error.
The average of the sum of squared errors.
Define root mean squared error.
The square root of the mean squared error.
What are the order of the forward, backward, and central difference methods?
Forward difference: First order; Backward difference: First order; Central difference: Second order.
Define global and local errors.
Global error: Accumulated error over all steps; Local error: Error at a single step.
What is the local error order of forward Euler’s method?
First order.
What is the global error of a numerical method with nth order local error?
Typically one order less than the local error.
Define phase portrait.
A graphical representation of trajectories in the phase plane.
What is a trajectory in a phase space?
The path that a system follows through the phase space.
What is a slope field?
A graphical representation showing the slope of a differential equation at various points.