0% found this document useful (0 votes)
22 views8 pages

Euler Method in Octave

This document describes the Euler method for solving systems of ordinary differential equations through approximation. It explains that the method involves solving a primarily nonlinear equation in small steps. It also presents the Runge-Kutta method for numerically solving differential equations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views8 pages

Euler Method in Octave

This document describes the Euler method for solving systems of ordinary differential equations through approximation. It explains that the method involves solving a primarily nonlinear equation in small steps. It also presents the Runge-Kutta method for numerically solving differential equations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SYSTEMS ENGINEERING

COMPUTATIONAL

Tema: Método de Euler

Nombre de la asignatura: Métodos


Numerical

Alumno: Jorge Brandon Vázquez Martínez

No. de Control: 21200639

Professor: Giovanny Felipe Garcia


The Gauss Euler method is a numerical method used to solve systems of
ordinary differential equations, allows finding solutions through approximation for
differential equations that are difficult to solve or cannot be solved in a manner
explicit. The Euler method is also called the "small steps method", since each
The step involves solving a primarily nonlinear equation.

In order to apply this method, a solution interval and the size must first be established.
of the spacing 'h'. This method offers a tabular solution for the function
solution, with corresponding y values for specific x values.

Geometric interpretation The initial condition of (6.1) represents the point P0 = (t0, y0) by
where the solution curve passes. For this point, it holds that dy/dt = f(t0, y0), which
allows us to draw a line that passes through point P0 and has a slope of f(t0, y0). This line,
approximate the solution in the vicinity of t0. Then, we take the line and find the
value of y corresponding to t1. Now we will have the point (t1, y1), and we repeat the process.
Code in Octave
SYSTEMS ENGINEER
COMPUTATIONAL

Topic: Runge Kutta Method

Subject Name: Methods


Numerical
Student: Jorge Brandon Vázquez Martínez

No. de Control: 21200639

Professor: Giovanny Felipe Garcia


Runge-Kutta methods are a series of numerical methods for solving equations
differentials (or systems of differential equations

Single-step linear methods

They are numerical methods in which to move to the next step, only the
information from the immediately previous step, that is, to advance to step n+1 it is only
necessary information about step n. Or more formally

Theory in extension

The Runge-Kutta methods are a particular case or a specialization of the


numerical methods of one step. What characterizes a Runge-Kutta method is that the error
it has the shape

Second-order Runge-Kutta method


If we use the first three terms of the Taylor expansion, we will have:

Fourth-order Runge-Kutta method


The formula that is most commonly applied is:
Note that k2 depends on k1; k3 on k2, and k4 on k3.

Octave commands for Runge Kutta:

1- Define the differential

2- Establish the initial conditions and parameters

Define the initial conditions, such as the initial value of y and the initial point x0.

Set the necessary parameters for the calculation, such as the step size h, the endpoint.
xf and any other parameter required by the differential equation.

3- Implement the RK4 method:

Use a for loop to iterate over the points in the interval [x0, xf] with increments of
step size h.

In each iteration, calculate the coefficients k1, k2, k3, and k4 using the following formulas:

where x(i) and y(i) represent the values of x and y in the current iteration.
Then, update the values of x and y using the following formula:

4- Visualize the results:

You can use visualization commands in Octave, such as plot, to graphically represent.
the results obtained.

You might also like