Untitled Flashcards Set

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/50

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

51 Terms

1
New cards

Is Python free to use?

Yes, Python is open-source software and free to use.

2
New cards

Is Python 2 still in use?

No, Python 2 has been officially retired. Most environments now use Python 3.

3
New cards

Can Python run on different operating systems?

Yes, Python is cross-platform and can run on Windows, macOS, and Linux.

4
New cards

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.

5
New cards

What is round-off error?

The error caused by approximating a number due to the finite precision of its representation.

6
New cards

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.

7
New cards

Name two root finding algorithms.

Newton Raphson Method and Bisection Method.

8
New cards

Are NumPy arrays the same as Python lists?

No, NumPy arrays are homogeneous and provide more functionality for numerical operations.

9
New cards

Can you store different data types within a NumPy array?

No, NumPy arrays are homogeneous; all elements must be of the same data type.

10
New cards

How to write ln(2^4) in Python NumPy syntax?

import numpy as np; result = np.log(2**4).

11
New cards

How to write log(10^-3) in Python NumPy syntax?

import numpy as np; result = np.log10(10**-3).

12
New cards

What do the three arguments of np.arange() represent?

Start value, stop value (exclusive), and step size.

13
New cards

What do the three arguments of np.linspace() represent?

Start value, stop value (inclusive), and number of samples.

14
New cards

What is the first element of np.arange(11,2,-2)?

15
New cards

What is the last element of np.arange(11,2,-2)?

16
New cards

What is the first element of np.linspace(2,15,20)?

2.0.

17
New cards

What is the last element of np.linspace(2,15,20)?

15.0.

18
New cards

Name three numerical differentiation methods.

Forward difference, Backward difference, Central difference.

19
New cards

What is the forward difference approximation?

(f(x + h) - f(x)) / h.

20
New cards

What is the backward difference approximation?

(f(x) - f(x - h)) / h.

21
New cards

What is the central difference approximation?

(f(x + h) - f(x - h)) / (2 * h).

22
New cards

What point do you lose with forward difference?

The last point.

23
New cards

What point do you lose with backward difference?

The first point.

24
New cards

What points do you lose with central difference?

The first and last points.

25
New cards

Name four numerical methods for solving ODEs.

Euler’s method, Runge-kutta methods, Adams-Bashforth methods, Finite difference methods.

26
New cards

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.

27
New cards

When solving ODEs numerically, are we given the ODEs?

Yes, the ODE must be known to solve it numerically.

28
New cards

Are initial values typically given when solving ODEs numerically?

Yes.

29
New cards

What is the goal of solving an ODE numerically?

To approximate the function that solves the ODE.

30
New cards

Define forward Euler’s method.

Explicitly updates the dependent variable using the function value at the current point.

31
New cards

Define backward Euler’s method.

Requires solving an implicit equation for the dependent variable at the next step.

32
New cards

What is the advantage of forward Euler’s method?

It provides an explicit update equation, making it easier to implement.

33
New cards

What is the disadvantage of backward Euler’s method?

It is more computationally expensive due to solving an implicit equation.

34
New cards

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.

35
New cards

Which methods are explicit and which are implicit?

Forward Euler: explicit; Backward Euler: implicit; Midpoint: explicit; RK4: explicit.

36
New cards

What are the steps to rewrite a higher-order ODE into a system of first-order ODEs?

  1. Define new variables for each derivative. 2. Rewrite the original ODE. 3. Write the system in matrix form. 4. Solve using numerical methods.

37
New cards

How many auxiliary variables are needed to rewrite a nth order ODE?

n-1 auxiliary variables.

38
New cards

Can you use forward Euler’s method with a system of first-order ODEs?

Yes.

39
New cards

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.

40
New cards

Define absolute error.

The absolute difference between the true value and the approximate value.

41
New cards

Define relative error.

The absolute error divided by the absolute value of the true value.

42
New cards

Define sum of squared error.

The sum of the squares of the differences between true values and approximations.

43
New cards

Define mean squared error.

The average of the sum of squared errors.

44
New cards

Define root mean squared error.

The square root of the mean squared error.

45
New cards

What are the order of the forward, backward, and central difference methods?

Forward difference: First order; Backward difference: First order; Central difference: Second order.

46
New cards

Define global and local errors.

Global error: Accumulated error over all steps; Local error: Error at a single step.

47
New cards

What is the local error order of forward Euler’s method?

First order.

48
New cards

What is the global error of a numerical method with nth order local error?

Typically one order less than the local error.

49
New cards

Define phase portrait.

A graphical representation of trajectories in the phase plane.

50
New cards

What is a trajectory in a phase space?

The path that a system follows through the phase space.

51
New cards

What is a slope field?

A graphical representation showing the slope of a differential equation at various points.