ΣνΜDr. Sharon's Math PlatformSyvara Learning
≈

Numerical Method with Python (Math & Eng)

Numerical techniques for solving mathematical problems using Python.

Q1
Find the root of $f(x) = x^3 - x - 2$ using the Bisection Method on the interval…
Find the root of $f(x) = x^3 - x - 2$ using the **Bisection Method** on the interval $[1, 2]$. Perform 3 iterations.
Root Finding 🟢 Intro </> Free with account
Q2
Apply Newton-Raphson method to find the root of f(x) = x^3 - 2x - 5 starting with x_0 =…
Apply Newton-Raphson method to find the root of f(x) = x^3 - 2x - 5 starting with x_0 = 2. Perform 3 iterations and compute the relative error at each step.
Root Finding 🟡 Intermediate </> 🔒 $1.99
Q3
The true value of a quantity is $V_{true} = 9.8$ m/s$^2$. An experiment measures…
The true value of a quantity is $V_{true} = 9.8$ m/s$^2$. An experiment measures $V_{approx} = 9.65$ m/s$^2$. (a) Compute the **absolute error**. (b) Compute…
Errors and Scientific Notation 🟢 Intro Free with account
Q4
Absolute and relative error of 3.14 and 3.1416 approximating π
Two approximations of $\pi = 3.14159265...$ are given: - Approximation A: $3.14$ - Approximation B: $3.1416$ (a) Express both approximations and the true…
Errors and Scientific Notation 🟡 Intermediate 🔒 $1.99
Q5
Python function compute_errors for absolute and relative error
Write a Python function `compute_errors(true_val, approx_val)` that returns: 1. The absolute error 2. The relative error (as a decimal) Test it with: - true =…
Errors and Scientific Notation 🟡 Intermediate 🔒 $2.99
Q6
Write the Taylor series expansion for $f(x) = \cos(x)$ centered at $a = 0$ for the first…
Write the Taylor series expansion for $f(x) = \cos(x)$ centered at $a = 0$ for the **first 6 terms** (up to $x^{10}$). Then use the expansion to approximate…
Taylor Series Approximation 🟡 Intermediate Free with account
Q7
Taylor series of x − cos x and remainder bound for |Rₙ| < 0.01
Let $f(x) = x - \cos(x)$. (a) Write the Taylor series expansion of $f(x)$ around $a = 0$ up to the **4th degree** term. (b) Using remainder term formula…
Taylor Series Approximation 🟡 Intermediate 🔒 $1.99
Q8
Write a Python function `taylor_cos(x, n_terms)` that approximates $\cos(x)$ using the…
Write a Python function `taylor_cos(x, n_terms)` that approximates $\cos(x)$ using the first `n_terms` terms of the Taylor series: $$\cos(x) \approx…
Taylor Series Approximation 🟡 Intermediate 🔒 $2.99
Q9
Simple iteration method for 2x − 3 = cos x, five iterations
Using the **Simple Iteration Method**, solve for $x$ in the equation: $$2x - 3 = \cos(x)$$ Choose initial value $x_0 = 1.5$ and compute the **first 5…
Root Finding: Simple Iteration 🟢 Intro 🔒 $0.99
Q10
The Simple Iteration Method may converge or diverge depending on how the equation is…
The Simple Iteration Method may **converge** or **diverge** depending on how the equation is rearranged. Consider solving $x^2 - 3x + 2 = 0$ (roots: $x = 1$…
Root Finding: Simple Iteration 🟡 Intermediate 🔒 $1.99
Q11
Write a Python function `simple_iteration(g, x0, tol=1e-6, max_iter=100)` that…
Write a Python function `simple_iteration(g, x0, tol=1e-6, max_iter=100)` that implements the Simple Iteration Method: - `g` is the rearranged function (e.g.,…
Root Finding: Simple Iteration 🟡 Intermediate 🔒 $2.99
Q12
Use the Bisection Method to find the root of $f(x) = x - \cos(x)$ on the interval…
Use the **Bisection Method** to find the root of $f(x) = x - \cos(x)$ on the interval $[0, 1]$. (a) Verify that a root exists on $[0, 1]$ using the…
Root Finding: Bisection Method 🟢 Intro 🔒 $0.99
Q13
Write a Python function `bisection(f, a, b, tol=1e-6)` that implements the Bisection…
Write a Python function `bisection(f, a, b, tol=1e-6)` that implements the Bisection Method: - Raise a `ValueError` if $f(a)$ and $f(b)$ have the same sign…
Root Finding: Bisection Method 🟡 Intermediate 🔒 $2.99
Q14
Bisection method iteration count for x − cos x on [0, 1]
For the Bisection Method applied to $f(x) = x - \cos(x)$ on $[0, 1]$: (a) Derive the formula for the **maximum number of iterations** $n$ needed to achieve an…
Root Finding: Bisection Method 🟡 Intermediate 🔒 $1.99
Q15
Apply the Newton-Raphson Method to find the root of $f(x) = x - \cos(x)$.
Apply the **Newton-Raphson Method** to find the root of $f(x) = x - \cos(x)$. (a) State the Newton-Raphson iteration formula…
Root Finding: Newton-Raphson Method 🟡 Intermediate 🔒 $1.99
Q16
Write a Python function `newton_raphson(f, df, x0, tol=1e-6, max_iter=50)` implementing…
Write a Python function `newton_raphson(f, df, x0, tol=1e-6, max_iter=50)` implementing the Newton-Raphson Method. - `f` is the function, `df` is its…
Root Finding: Newton-Raphson Method 🟡 Intermediate 🔒 $2.99
Q17
Compare the three root-finding methods — Simple Iteration, Bisection, and Newton-Raphson…
Compare the three root-finding methods — **Simple Iteration**, **Bisection**, and **Newton-Raphson** — applied to $f(x) = x - \cos(x)$ on $[0,1]$. (a) State…
Root Finding: Newton-Raphson Method 🔴 Advanced 🔒 $1.99
Q18
Dot product, matrix sum/difference, and AB vs BA
Given vectors $\mathbf{u} = [2, -1, 3]$ and $\mathbf{v} = [4, 0, -2]$, and matrices: $$A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, \quad B =…
Matrix Operations and Linear Systems 🟢 Intro 🔒 $0.99
Q19
3×3 linear system in matrix form, augmented matrix, verify solution
Consider the linear system: $$2x + 3y - z = 7$$ $$x - y + 2z = -1$$ $$3x + y + z = 4$$ (a) Write the system in matrix form $A\mathbf{x} = \mathbf{b}$.…
Matrix Operations and Linear Systems 🟡 Intermediate 🔒 $1.99
Q20
NumPy: sum, product, transpose, determinant of 3×3 matrices
Using NumPy, define the matrices: $$A = \begin{bmatrix} 2 & 3 & -1 \\ 1 & -1 & 2 \\ 3 & 1 & 1 \end{bmatrix}, \quad B = \begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & -1…
Matrix Operations and Linear Systems 🟡 Intermediate 🔒 $2.99
Q21
Solve the following linear system by row-reducing the augmented matrix to Reduced Row…
Solve the following linear system by row-reducing the augmented matrix to **Reduced Row Echelon Form (RREF)**: $$x + 2y - z = 3$$ $$2x + y + z = 7$$ $$x - y +…
Solving Linear Systems: RREF and Matrix Inverse 🟡 Intermediate 🔒 $1.99
Q22
NumPy: solve Ax = b with linalg.solve and inverse
Solve the linear system $A\mathbf{x} = \mathbf{b}$ using Python, where: $$A = \begin{bmatrix} 2 & 1 & -1 \\ -3 & -1 & 2 \\ -2 & 1 & 2 \end{bmatrix}, \quad…
Solving Linear Systems: RREF and Matrix Inverse 🟡 Intermediate 🔒 $2.99
Q23
Write a Python program that solves $f(x) = x - \cos(x)$ using all three methods — Simple…
Write a Python program that solves $f(x) = x - \cos(x)$ using all three methods — Simple Iteration, Bisection, and Newton-Raphson — and produces a…
Solving Linear Systems: RREF and Matrix Inverse 🔴 Advanced 🔒 $2.99
Q24
RK4 step for y' = y − t²
For $y' = y - t^2 + 1$, $y(0) = 0.5$, take one step of classical Runge-Kutta (RK4) with $h = 0.5$. Compare with the exact solution $y(t) = (t+1)^2 - 0.5e^t$.
ODE Solvers 🟡 Intermediate 🔒 $1.99
Q25
Second-order Runge-Kutta for y' = x + y, y(0) = 0
Given the initial value problem $$y' = x + y, \qquad y(0) = 0,$$ find the value of $y$ approximately at $x = 0.5$ by the **second-order Runge-Kutta method**…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q26
RK2: y' = (y - x)/(1 + x), y(0) = 1 at x = 0.1 (h = 0.02)
Using the **second-order Runge-Kutta method**, find the value of $y$ at the point $x = 0.1$ for $$\dfrac{dy}{dx} = \dfrac{y - x}{1 + x}, \qquad y(0) = 1$$…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q27
RK2: y y' = x, y(0) = 1.5 at x = 0.2 (h = 0.1)
Using the **second-order Runge-Kutta method**, find the value of $y$ at the point $x = 0.2$ for $$y\,y' = x, \qquad y(0) = 1.5$$ (take $h = 0.1$). Compare the…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q28
RK2: y' = x - y, y(0) = 1 at x = 0.2 (h = 0.1)
Using the **second-order Runge-Kutta method**, find the value of $y$ at the point $x = 0.2$ for $$\dfrac{dy}{dx} = x - y, \qquad y(0) = 1$$ (take $h = 0.1$).…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q29
RK2: y' = x + y + xy, y(0) = 1 at x = 0.1 (h = 0.02)
Using the **second-order Runge-Kutta method**, find the value of $y$ at the point $x = 0.1$ for $$y' = x + y + xy, \qquad y(0) = 1$$ (take $h = 0.02$).…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q30
RK2: y' = 1 + y^2, y(0) = 0 at x = 0.4 (h = 0.2)
Using the **second-order Runge-Kutta method**, find the value of $y$ at the point $x = 0.4$ for $$\dfrac{dy}{dx} = 1 + y^2, \qquad y(0) = 0$$ (take…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q31
RK2: y' = (y + x)/(1 + x), y(0) = 1.2 at x = 0.1 (h = 0.025)
Using the **second-order Runge-Kutta method**, find the value of $y$ at the point $x = 0.1$ for $$\dfrac{dy}{dx} = \dfrac{y + x}{1 + x}, \qquad y(0) = 1.2$$…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q32
RK2: y y' = 2x, y(0) = 1.2 at x = 0.3 (h = 0.1)
Using the **second-order Runge-Kutta method**, find the value of $y$ at the point $x = 0.3$ for $$y\,y' = 2x, \qquad y(0) = 1.2$$ (take $h = 0.1$). Compare…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q33
RK2: y' = 2x - y, y(0) = 0.8 at x = 0.3 (h = 0.1)
Using the **second-order Runge-Kutta method**, find the value of $y$ at the point $x = 0.3$ for $$\dfrac{dy}{dx} = 2x - y, \qquad y(0) = 0.8$$ (take…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q34
RK2: y' = 1 + x + y + xy, y(0) = 0.5 at x = 0.1 (h = 0.025)
Using the **second-order Runge-Kutta method**, find the value of $y$ at the point $x = 0.1$ for $$y' = 1 + x + y + xy, \qquad y(0) = 0.5$$ (take $h = 0.025$).…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q35
RK2: y' = 4 + y^2, y(0) = 0 at x = 0.3 (h = 0.1)
Using the **second-order Runge-Kutta method**, find the value of $y$ at the point $x = 0.3$ for $$\dfrac{dy}{dx} = 4 + y^2, \qquad y(0) = 0$$ (take…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q36
Euler's method for y' = 3y: local and global truncation error
Consider the initial-value problem $y' = 3y$, $y(0) = 1$. The analytic solution is $y = e^{3x}$. **(a)** Approximate $y(0.10)$ using one step and Euler's…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q37
Euler step and exact solution for y' = x - 3y, y(0) = 1
Given the initial-value problem $y' = x - 3y$, $y(0) = 1$. **(a)** Approximate $y(0.1)$ using one step and Euler's method. **(b)** Find the analytic solution.…
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q38
Second-order Runge-Kutta for y' = x^2 + y^2, y(0) = 1
Use the second-order Runge-Kutta method with $h = 0.1$ to approximate $y(0.5)$, given $$y' = x^2 + y^2, \qquad y(0) = 1.$$
ODE Solvers 🟡 Intermediate </> 🔒 $1.99
Q39
Explicit finite-difference method for u_t = u_xx, u(x,0) = sin(pi x)
Use the explicit finite-difference method with $m = 5$ subintervals in $x$ and $n = 50$ subintervals in $t$ to approximate the solution of $$\begin{aligned}…
PDE: Finite Differences 🟡 Intermediate </> 🔒 $1.99
Working…