Codes of lesson of numerical analysis in winter and spring of 2023. All the exercises are there and in this order that I write here.
In numerical analysis, Newton's method, also known as the Newton–Raphson method, named after Isaac Newton and Joseph Raphson, is a root-finding algorithm which produces successively better approximations to the roots (or zeroes) of a real-valued function. The most basic version starts with a single-variable function f defined for a real variable X, the function's derivative f′, and an initial guess X0 for a root of f. If the function satisfies sufficient assumptions and the initial guess is close, then
is a better approximation of the root than X0. Geometrically, (X1, 0) is the intersection of the x-axis and the tangent of the graph of f at (X0, f(X0)): that is, the improved guess is the unique root of the linear approximation at the initial point. The process is repeated as
until a sufficiently precise value is reached. The number of correct digits roughly doubles with each step. This algorithm is first in the class of Householder's methods, succeeded by Halley's method. The method can also be extended to complex functions and to systems of equations.
This code calculate the answer of some equations that is hard to find its exact value.
In this code I analysis the price of dollar in Iran of after revolusion. This analysis is in two way one of them is in simple way another one in logarithmic way.
This code calculate the integral of some function that is hard to calculate its exact value.
In this code I calculate the real answer of difference of function sin(3x) and its approximate value and plot table and chart to show that if we choose a small h we can find its approximate answer so close to real answer.
In this code I solve the system of equation for answer one Differential equation that is unanswerable.
SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python.
This file is a set of 5 problems about sympy library.
Problem 1: Finding derivative of functions by sympy.
Problem 2: Finding the indefinite integral.
Problem 3: Solve equations.
Problem 4: Finding 10 terms of Fourier series.
Problem 5: Find velocity and acceleration from function
NumPy is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays.
Pandas is a fast, powerful, flexible and easy to use open source data analysis and manipulation tool, built on top of the Python programming language.
This file is a set of 3 problems about numpy and pandas.
Problem 1: Numpy tasks
Problem 2: Pandas tasks
Problem 3: Bonus task
In mathematics, the Taylor series or Taylor expansion of a function is an infinite sum of terms that are expressed in terms of the function's derivatives at a single point. For most common functions, the function and the sum of its Taylor series are equal near this point.
In this file we plot taylor's and real functions of
A Fourier series is an expansion of a periodic function into a sum of trigonometric functions. The Fourier series is an example of a trigonometric series, but not all trigonometric series are Fourier series. By expressing a function as a sum of sines and cosines, many problems involving the function become easier to analyze because trigonometric functions are well understood.
In this file we plot Fourier series and origin function of
There are three main sources of errors in numerical computation: rounding, data uncertainty, and truncation. Rounding errors, also called arithmetic errors, are an unavoidable consequence of working in finite precision arithmetic.
In numerical analysis, the condition number of a function measures how much the output value of the function can change for a small change in the input argument. This is used to measure how sensitive a function is to changes or errors in the input, and how much error in the output results from an error in the input.
In this file we work on Bisection and False Point.
In geometry, bisection is the division of something into two equal or congruent parts (having the same shape and size). Usually it involves a bisecting line, also called a bisector.
The false position method is one of the iterative methods of finding the roots of a non-linear equation of the form f(x) = 0. This method provides us with a better approximation of the roots of the equation.
Calculate the value of
Calculate the 15 sequence sentences by these two algorithms.
1.
2.
Because the first algorithm is not stable so, we can see that the answer is not same but if we simplify that we see both of them must have same value.