Você está na página 1de 7

Introduction

Numerical methods for ordinary differential equations are methods used to


find numerical approximations to the solutions of ordinary differential equations (ODEs).
Many differential equations cannot be solved using symbolic computation
("analysis"). For practical purposes, however such as in engineering a numeric
approximation to the solution is often sufficient. The algorithms applied here can be used
to compute such an approximation.
Suppose that a variable y depends on another variable x, i.e. y = f(x), but we only
know the values of f at a finite set of points
(x1 , y1),(x2 , y2),., (xn , yn)
Suppose then that we need information about the derivative of f(x). One obvious idea
would be to approximate f(x) by the Forward Difference
f '(x) =

f ( x +h)f ( x)
h

This formula follows directly from the definition of the derivative in calculus. An alternative
would be to use a Backward Difference

f '(x) =

f ( x ) f ( xh)
h

Since the errors for the forward difference and backward difference tend to have opposite
signs, it would seem likely that averaging the two methods would give a better result than
either alone. If the points are evenly spaced then averaging the forward and backward
differences leads to a symmetric expression called the Central Difference

f '(x) =

f ( x +h)f ( xh)
2h

It is important to note that Numerical Differentiation is not particularly accurate


process. It suffers from a conflict between round off errors and error inherent in
interpolation. For this reason, a derivative of a function can never be computed with the
same precision as the function itself.
How to use:
This solver allows three methods of approximating the derivative of a function using
forward, backward and central difference formulas.
To find the solution for a given differential equation, the value of x, step size (h), and the
equation itself must be supplied to the Numerical Differentiation solver. This is done by
entering the values at its respective numeric controls in the front panel and placing an
equation that is a function of the variable x.
After supplying the needed inputs, the user has to press solve and the approximated
derivative of the function will appear. The user has to press button new if he/she wish to
solve for a new inputs.

Limitations:
Listed below are the Dos and Donts in using the Numerical Differentiation Solver:
1. Correct syntax must be observed when placing the equation otherwise an error would
occur. Shown in table 1.1 are some functions that can be placed at the equation box with
its respective description.
Table 1.1 equivalent syntax for different math functions
Input function
abs(x)
acos(x)

Math function
Absolute Value
Inverse Cosine

acosh(x)

Inverse Hyperbolic Cosine

asin(x)

Inverse Sine

asinh(x)

Inverse Hyperbolic Sine

atan(x)

Inverse Tangent

atanh(x)

Inverse Hyperbolic Tangent

cos(x)

Cosine

cosh(x)

Hyperbolic Cosine

cot(x)

Cotangent

csc(x)

Cosecant

Description
Returns the absolute value
of x.
Computes the inverse cosine
of x.
Computes the inverse
hyperbolic cosine of x in
radians.
Computes the inverse sine of
x in radians.
computes the inverse
hyperbolic sine of x in
radians.
Computes the inverse
tangent of x in radians.
Computes the inverse
hyperbolic tangent of x in
radians.
Computes the cosine of x in
radians.
Computes the hyperbolic
cosine of x in radians.
Computes the cotangent of x
in radians (1/tan(x)).
Computes the cosecant of x

exp(x)

Exponential

ln(x)

Natural Logarithm

log(x)

Logarithm Base 10

log2(x)

Logarithm Base 2

pi(x)

Represents the value =


3.14159...

sec(x)

Secant

sin(x)

Sine

sinh(x)

Hyperbolic Sine

sqrt(x)

Square Root

tan(x)
tanh(x)

Tangent
Hyperbolic Tangent

in radians (1/sin(x)).
Computes the value of e
raised to the power x.
Computes the natural
logarithm of x (to the base
e).
Computes the logarithm of x
(to the base 10).
Computes the logarithm of x
(to the base 2).
pi(x) = x*
pi(1) =
pi(2.4) = 2.4*
Computes the secant of x
(1/cos(x)).
Computes the sine of x in
radians.
Computes the hyperbolic
sine of x in radians.
Computes the square root of
x.
Tangent
Computes the
hyperbolic tangent of x in
radians.

2. For variable and function names, only lowercase letters are allowed. This solver
interprets capital letters as errors.
3. For the sake of uniqueness, all numbers in exponential notation use the 1E-1 convention
(with the capital letter E). Using 1e-1 (with the lowercase letter e) results in an error
message.
Table1.2 Summary of Frequently committed errors when placing the equation
Error Description
Bracket problem at the beginning
Incomplete function expression
Bracket problem
Bracket problem at the end
Wrong number format
Wrong function call
Not a valid function
Incomplete expression
Wrong letter
Contains more than one variable

Error example
1+x)
sin(x)+
()
(1+x
1e-3 instead of 1E-3
sin()
sins(x)
x+
sin(X)
1+x+y4

4. To have a more accurate solution for a particular equation, the user must use a smaller
stepsize.

Introduction:

An efficient procedure for solving b=Ax is the LU decomposition. While other methods such
as Gaussian elimination method and Choslesky method can do the job well, this LU
decomposition method can help accelerate the computation.
The LU decomposition method first decomposes matrix A into A= LU, where Land U are
lower triangular and lower triangular matrices, respectively. More precisely if Ais a nxn
matrix, L and U are also nxn matrices with the forms like the following:

The lower triangular matrix L has zeros in all entries above its diagonal and the upper
triangular matrix U has zeros in all entries below its diagonal. If the LU-decomposition
of A = L.U is found, the original equation becomes B = (L.U).X. This equation can be
rewritten as B = L.(U.X). Since L and B are known, solving for B = L.Y gives Y = U.X. Then,
since U and Y are known, solving for X from Y = U.X yields the desired result. In this way,
the original problem of solving for X from B = A.X is decomposed into two steps:
1. Solving for Y from B = L.Y
2. Solving for X from Y = U.X
For LU Decomposition, The procedure based on unity elements on the diagonal of matrix L
is called Do littles method (or Gauss factorization), while the procedure based on unity
elements on the diagonal of matrix U is called Crouts method.
How to use:

This solver allows two method to find solution of a system of linear equaions. The first one
is CROUTs METHOD and the second one is the Do Littles method. By pressing its
respective button, the user will be able to use his desired method. The user also has to
choose between 3x3 or 4x4 matrix depending on the given linear equations. Take note that
the activated button is the highlighted button. After choosing the method and the size,
the user can now fill the coefficients of the system of linear equation.
At the bottom of the front panel ,the LU matrix for the system of linear equation is shown.

introduction
In numerical analysis, LU decomposition (where 'LU' stands for 'Lower Upper', and also
called LU factorization) factors matrix as the product of a lower triangular matrix and an
upper triangular matrix. The product sometimes includes permutation matrix as well. The
LU decomposition can be viewed as the matrix form of Gaussian elimination.

In linear algebra, the Crout matrix decomposition is an LU decomposition which


decomposes a matrix into a lower triangular matrix (L), an upper triangular matrix (U)
The Crout matrix decomposition algorithm differs slightly from the Doolittle method.
Doolittle's method returns a unit lower triangular matrix and an upper triangular matrix,
while the Crout method returns a lower triangular matrix and a unit upper triangular
matrix.

Você também pode gostar