This calculator has neither solve key nor eqn mode

Transcription

This calculator has neither solve key nor eqn mode
Final Activity
Pablo Guerrero-García <[email protected]>
20/11/2011, Page 1 of 5
This calculator has neither solve key nor eqn mode∗
Pablo Guerrero-Garcı́a
e-mail: [email protected]
Department of Applied Mathematics, University of Málaga
Complejo Tecnológico, ETSI Telecomunicación
Campus de Teatinos s/n, 29010 Málaga (Spain)
20th November 2011
Abstract
A nonlinear equation is an equation in which the independent variable cannot be singled out in terms
of an expression that does not depend on that variable. The algebraic equations (to compute roots of
polynomials) of degree greater than four are particular cases, and searching for critical points of a realvalued function of a real variable can be accomplished with those techniques. In this article we describe
how to deliver a lecture to teach the way in which a nonlinear equation is solved by a calculator (like
casio fx82-es) that has neither solve key nor eqn mode, including several examples, exercises and
assessment activities.
Key words: nonlinear equation; bisection; successive approximations; fixed point; Newton; critical points
of real-valued functions of real variable; calculator; casio fx82-es.
1
Introduction
There are a lot of situations in which one has to solve a nonlinear equation, an equation in which the
independent variable cannot be singled out in terms of an expression that does not depend on that variable.
The algebraic equations (to compute roots of polynomials) of degree greater than four are particular cases,
and searching for critical points of a real-valued function of a real variable can be accomplished with those
techniques. In fact, in engineering we often have to compute the zeros and the poles of the transfer function
of a circuit, which is a rational function (i.e., a quotient of polynomials): the zeros are the roots of the
numerator, and the poles are those of the denominator [5, p. 315, p. 157]. We also have to solve a nonlinear
equation when we want to adjust the resistance of a potentiometer for energy dissipation, or when we want
to determine the angular frequency for the impedance of an RLC circuit in parallel to have some given value
or to be as large as possible, only referencing a couple of situations taken from [6, p. 742].
Throughout this article we illustrate several iterative techniques to deal with the simplest particular
case, that in which we have to solve an algebraic equation of third degree taken from [1, §2]. In spite of
its simplicity, this case will allow us to use the very same nonlinear equation throughout the whole article,
leaving other nonlinear equations for the exercises and assessment sections. We are supposed to construct
a sequence {xn ∈ R} whose limit being the root x∗ ∈ R of
f (x) = x3 + 4x2 − 10 = 0.
Nowadays there are calculators, like casio fx570-es [3], which have an eqn mode to solve algebraic
equations up to third degree, as well as a solve key to deal with those of higher degree or with nonlinear
equations in general. Our challenge here is to be able to tackle such problems with a calculator like casio
fx82-es [2], that has neither solve key nor eqn mode.
∗
Tech. Report MA-11/01 (http://www.matap.uma.es/investigacion/tr.html), Dept. Applied Mathematics, Univ. Málaga,
20th November 2011. This work constitutes the author’s mandatory final activity for the Thales/CICA course “Scientific
calculators as a didactic resource in the Mathematics area (Spanish)” (MAT11-07-CALCIE) delivered through its virtual
platform from 17th October until 18th December 2011.
1
Final Activity
Pablo Guerrero-García <[email protected]>
20/11/2011, Page 2 of 5
As an appendix to this article, we have included the keystrokes sequences to be pushed to solve the
four examples E1 – E4 from sections 2–4, their corresponding screen captures, as well as the keystrokes
sequences to be pushed to solve exercises E1 – E4 put forward to the student in section 5, with their
corresponding screen captures too. Students are strongly recommended to rework the examples and to
compare the solutions to the exercises with their own solutions in order to be able to tackle successfully the
assessment activities A1 – A4 included in section 6.
2
Bisection method
This method is one that proceeds slowly but surely: once an interval [a, b] in which f ∈ C[a, b] is such
that f (a)f (b) < 0 is found, Bolzano’s theorem guarantees the existence of at least one root x∗ such that
f (x∗ ) = 0. In fact, the proof of this theorem constitutes the method known as bisection method, in which
we are supposed to generate a sequence of intervals [an , bn ] smaller and smaller in such a way that we can
guarantee that x∗ belongs to any of them. The iteration point xn+1 is the midpoint of such an interval.
If f (an )f (xn+1 ) > 0 then we restrict the left endpoint of the interval letting an+1 = xn+1 and bn+1 = bn ,
otherwise we restrict the right endpoint letting an+1 = an y bn+1 = xn+1 , and this process is repeated.
E1 Once stated, by using the table mode, that there must be a root in [a0 , b0 ] = [1, 2] because a change
of sign is seen when evaluating f , we are supposed to perform 5 iterations of the bisection method. In this
case we will work in 10-digit arithmetic, namely that used by default in casio fx82-es. Apart from using
variables a, b and x to store the left endpoint, the right endpoint and the iteration point (respectively), we
use c, d e y to store the corresponding values of f for efficiency. It can be seen that in the first and third
iteration was the right endpoint the one being restricted, and it was the left one in the remaining iterations.
The approximation we get for x∗ is x5 ≈ 1.34375, but f (x5 ) ≈ −0.3510 6= 0 and hence we can sense that we
are still way far from x∗ .
Bisection is the most basic method from a family known as bracketing methods, those that try to speed up
the process described above but without losing the termination guarantee of the process. Rather than giving
their details, let us go on to describe another kind of more rapidly converging methods, since the usefulness
of the bracketing methods is just to provide a good starting point for the quicker ones and bisection is more
than enough here. Students are recommended to solve exercise E1 .
3
Successive approximation methods
A method of successive approximations (MSA), also known as fixed point iteration, consists of firstly rewriting
the nonlinear equation f (x) = 0 as x = g(x), and then state the iterative method that, starting from some
x0 ∈ R, generates the sequence {xn ∈ R} by xn+1 = g(xn ) which hopefully converges to a fixed point x∗ of
g, namely a value x∗ such that x∗ = g(x∗ ), and that we will assume for consistency that it is also a root of
f (i.e., that f (x∗ ) = 0).
In spite of the simplicity of the case we are dealing with, we have a lot of possibilities to rewrite f (x) = 0
as x = g(x), the following ones being among them (cf. [1, §2.2]):
(a) Adding x to both sides and singling the leftmost x out:
x + x3 + 4x2 − 10 = x
x = x − x3 − 4x2 + 10 = ga (x)
(b) Singling x3 out, dividing into x, raising to 1/2 both sides, and taking the positive sign into account:
r
10
10
3
2
2
x = −4x + 10
x =
− 4x
x=+
− 4x = gb (x)
x
x
(c) Isolating the 10, factoring x2 , singling x2 out, raising to 1/2, and taking the positive sign into account:
r
10
10
3
2
2
2
x + 4x = x (x + 4) = 10
x =
x=+
= gc (x)
x+4
x+4
Final Activity
Pablo Guerrero-García <[email protected]>
20/11/2011, Page 3 of 5
(d) Singling x2 out, raising to 1/2 both sides, and taking the positive sign into account:
√
10 − x3
+ 10 − x3
2
x =
x=
= gd (x)
4
2
(e) It can also be rewritten as:
2x3 + 4x2 + 10
=
3x2 + 8x
3x3 + 8x2 − x3 − 4x2 + 10
3x3 + 8x2 x3 + 4x2 − 10
x3 + 4x2 − 10
=
=
−
=
x
−
= ge (x)
3x2 + 8x
3x2 + 8x
3x2 + 8x
3x2 + 8x
x3 + 4x2 − 10 = 0
3x3 + 8x2 = x(3x2 + 8x) = 2x3 + 4x2 + 10
x=
In this section and the next one we will deal with the latter two, leaving the former three as exercise E2 for
the student after showing him the following example, which already appeared in [5, p. 311, p. 153]. Without
leading to confusion, we will keep on using g when we refer to gd in this section, or ge in the next one.
E2 Now we are going to work in 7-digit arithmetic, which can be selected in the calculator by letting sci
be 7. It is also appropriate to select lineio for not being dealing with fractions (as mathio would be) when
displaying the iteration point that is stored in the variable x. As we want to keep 7 rounded significant digits
after each iteration, we use rnd before the call to g, and the suitably rounded result is assigned again to x
in order to be able to repeat the process simply pushing the = key. We get convergence after 20 iterations
since x20 = x19 ≈ 1.365230, thus providing an approximation with 7 correctly rounded significant digits to
the x∗ such that f (x∗ ) = 0.
We have been lucky in this case and we have got convergence, but this is not always necessarily so. Fortunately we have a sufficient condition theorem at our disposal, known as fixed point theorem, which states
that if the following threee conditions hold
g ∈ C 1 [a, b]
and
∀x ∈ [a, b], g(x) ∈ [a, b]
and
∀x ∈ [a, b], |g 0 (x)| ≤ L < 1,
then it can be guaranteed that the sequence {xn ∈ R} generated by xn+1 = g(xn ) converges, starting from
any x0 ∈ [a, b] (which is known as global convergence in that interval), to an unique fixed point x∗ ∈ [a, b]
of g. Notice that the function for which these conditions must hold is g (not f ), that the interval must
be closed, that the first condition is that g is continuous and with continuous derivative in [a, b], that the
second condition is read “g maps [a, b] to [a, b]”, that in the third condition it is |g 0 | (not g 0 ) being bounded
from above, and that if these three conditions do not hold then we can conclude nothing.
E3 As was done in [4, p. 118b], let us determine a closed interval in which we can guarantee the global
convergence for the MSA of the example above. The table mode is all right for us in this case to check
first that 10 − x3 neither takes negative values nor vanishes in [1, 2], which would compromise the condition
that g ∈ C 1 [1, 2] since that term appears both under the square root in g and in the denominator of g 0 .
After editing the expression above for g(x) = (1/2)(10 − x3 )1/2
√ to appear in the table mode, we note that
it does not hold that g maps [1, 2] to [1, 2], because g(2) = 2/2 ≈ 0.7071 < 1 and this is the reason why
we can not guarantee global convergence in [1, 2]. However, we can answer in the affirmative if [1, 1.5] is
considered: we have to edit the expression above for g 0 (x) to appear in the table mode, and we check that
1
∀x ∈ [1, 1.5] , g 0 (x) = (10 − x3 )−1/2 (−3x2 ) < 0.
4
Since g(x) is continuous
in [1, 1.5], this implies that g(x) is decreasing in that interval; as g(1) = 1.5 and
p
g(1.5) = (1/4) 53/2 ≈ 1.287 > 1, we conclude that g maps [1, 1.5] to [1, 1.5]. To bound |g 0 (x)| from above
in that interval, we note that
1
1
∀x ∈ [1, 1.5] , g 00 (x) = (10 − x3 )−1/2 (−6x) − (10 − x3 )−3/2 (−3x2 )2 < 0.
4
8
0
0
Since g (x) is continuous in [1, 1.5], this implies that g (x) is decreasing in that interval, and hence |g 0 (x)|
will be increasing and bounded from above by |g 0 (1.5)| ≈ | − 0.6556| ≤ 0.66 = L < 1 in that interval. This
altogether allows us to guarantee global convergence in [1, 1.5]: in fact, in example E2 we started from
x0 = 1.5 and we got convergence.
Before proceeding to the last section of contents, students are recommended to solve exercise E3 .
Final Activity
4
Pablo Guerrero-García <[email protected]>
20/11/2011, Page 4 of 5
Newton’s method
Newton’s method is an MSA in which g(x) = x−f (x)/f 0 (x). Option (e) from preceding section corresponds to
that choice, and this method is supposed to have a very rapid convergence if the starting point is sufficiently
close to the root, which is known as local convergence. Said another way, all we can ensure is that there
exists a δ > 0 such that this MSA is globally convergent in [x∗ − δ, x∗ + δ] ⊂ [a, b]; furthermore, when
convergence is present this is usually very rapid, as we are going to illustrate in our last example.
E4 We are supposed to apply Newton’s method starting from x0 = 1.5 to solve the nonlinear equation
in hand. In this case we are going to work in 7-digit arithmetic as well, hence at the beginning we proceed
as we did in example E2 and then we input x − f (x)/f 0 (x) as g(x) instead of the g(x) we used in that
example. Although we could have simplified a little the expression for g(x)—this is often appropriate, as
for example in the assessment activities from section 6—, we have input as is for clarifying purposes. We
got convergence in only 4 iterations (in example E2 we needed 20) since x4 = x3 ≈ 1.365230, and we got
an approximation with 7 correctly rounded significant digits to the x∗ such that f (x∗ ) = 0.
Now is the right time for students to solve exercise E4 . We finish by warning the student about the fact
that Newton’s method is not the panacea: it can be stuck due to symmetries of the function, or numerical
difficulties can arise when the derivative in the iteration point is nearly zero. This is one of the reasons why
it is advisable to know about the general theory of the methods of succesive approximations. Moreover,
the techniques described above can be used to compute critical points of a real-valued function of a real
variable, since the first-order optimalty condition implies solving the nonlinear equation put forward when
imposing the derivative of that function to vanish. We will manage this kind of situations in the assessment
activities A1 – A4 .
5
Exercises
In this section we collect the exercises we have referred to in the preceding sections. Students are recommended to try them by themselves—following the methodology introduced in the examples–and to compare
their own solutions against the solutions to them that we provide as an appendix.
E1 Working in 10-digit arithmetic, perform 5 iterations of the bisection method to find a root of f (x) =
x − cos(x) = 0.
E2 Working in 7-digit arithmetic, perform several fixed point iterations starting from x0 = 1.5 to try to
find a fixed point of
(a) ga (x) = x − x3 − 4x2 + 10
r
10
(b) gb (x) = +
− 4x
x
r
10
(c) gc (x) = +
4+x
Make a comment on the results obtained, in connection with those of example E2 .
E3 Determine an interval in which you can guarantee global convergence of the MSA with g(x) = cos(x)
to solve the nonlinear equation of exercise E1 .
E4 In order to solve the nonlinear equation of exercise E1 , compare the number of iterations needed
by the MSA of exercise E3 against the number of iterations needed by Newton’s method, starting both
methods from the midpoint of the interval determinaded in that exercise and working in 6-digit arithmetic.
Apply the method you find more rapidly convergent working in 10-digit arithmetic as well.
Final Activity
6
Pablo Guerrero-García <[email protected]>
20/11/2011, Page 5 of 5
Assessment
Finally, in this section we include the relevant problems from the final exams celebrated in June and
September 2011 on the subjects “Statistics and Numerical Methods” and “Mathematics 4” corresponding
to the second quarter of the first course of the new degrees in Electrical/Electronics Engineering at the
University of Málaga (Spain). It is worth noting that all of them can be tackled with the techniques
described here. In fact, throughout the course and of course when taking the exam, students can (and must)
use a calculator whose features do not go beyond those of casio fx570-es.
A1 Starting from x0 = 0, compute—with 2 correct decimals—a real root of the nonlinear equation
f (x) = x3 − 2x − 2 = 0 with both Newton’s method and that of successive approximations xk+1 = g(xk ),
where
1
g(x) = (−x3 + 9x − 2).
7
In addition, find a closed interval between two consecutive integers in which you can guarantee global
convergence of some of those methods to such a real root.
A2 Using x0 = 0, compute—with 2 correct decimals—a critical point of x4 /4 − x2 − 2x in [−2, 2] with
both Newton’s method and that of successive approximations xk+1 = g(xk ), where
1
g(x) = (−x3 + 10x + 2).
8
In addition, find a closed interval between two consecutive integers in which you can guarantee global
convergence of some of those methods to such a critical point.
A3 Starting from x0 = 2, compute—with 2 correct decimals—a root of f (x) = 0 in [0, 2] by performing 6
iterations in 4-digit arithmetic of both Newton’s method and that of successive approximations xk+1 = g(xk ),
where
√
2f (x)
f (x) = 3 x − 1
and
g(x) = x − 0
.
5f (x)
In addition, examine whether you can guarantee global convergence of some of those methods in such a
closed interval.
A4 Starting from x0 = 2, compute—with 2 correct decimals—a root of f (x) = 0 in [0, 2] by performing 7
iterations in 5-digit arithmetic of both Newton’s method and that of successive approximations xk+1 = g(xk ),
where
√
f (x)
f (x) = 3 ex − 1
.
and
g(x) = x − 0
3f (x)
In addition, examine whether you can guarantee global convergence of some of those methods in such a
closed interval.
References
[1] Richard L. Burden and J. Douglas Faires. Numerical Analysis, 8th edition. International Thomson
Publishing, Belmont (CA, USA), 2005.
[2] CASIO. FX-82ES User’s Guide. Casio, 2004.
[3] CASIO. FX-570ES User’s Guide. Casio, 2004.
[4] Pablo Guerrero-Garcı́a. Slides for a Course on Numerical Methods (Spanish). Dpto. Matemática Aplicada, Universidad de Málaga, December 2003.
[5] Pablo Guerrero-Garcı́a and Ángel Santos-Palomo. Squeezing the most out of the CASIO FX-570MS for
electrical/electronics engineers. Proc. CMMSE 2008 (vol. 1, ISBN 9788461219827), pp. 307–322, 2008.
Spanish translation for Epsilon-Revista Educación Matemática, vol. 27(3), núm. 76, pp. 149–164, 2010.
[6] Pablo Guerrero-Garcı́a and Ángel Santos-Palomo. Motivational numerical examples for electrical/electronics engineers. Proc. APLIMAT 2010 (ISBN 9788089313471), pp. 739–747, 2010. Both English
and Spanish versions available at http://www.matap.uma.es/investigacion/tr/ma06 01r.pdf
Actividad Final
Pablo Guerrero García <[email protected]>
20/11/2011, Page 1 of 5
Esta calculadora ni tiene tecla solve ni modo eqn*
Pablo Guerrero Garcı́a
e-mail: [email protected]
Departamento de Matemática Aplicada, Universidad de Málaga
Complejo Tecnológico, ETSI Telecomunicación
Campus de Teatinos s/n, 29010 Málaga (Spain)
20 de noviembre de 2011
Resumen
Una ecuación no lineal es una ecuación en la que no se puede despejar la variable independiente en términos
de una expresión que no dependa de ella; las ecuaciones algebraicas (para calcular raı́ces de polinomios)
de grado mayor que cuatro son casos particulares, y la búsqueda de puntos crı́ticos de una función real
de variable real puede hacerse con dichas técnicas. En este artı́culo describiremos cómo desarrollar una
clase para enseñar a resolver una ecuación no lineal con una calculadora (como la casio fx82-es) que no
disponga ni de tecla solve ni de modo eqn, incluyendo ejemplos, ejercicios y actividades de evaluación.
Palabras clave: ecuación no lineal; bipartición; aproximaciones sucesivas; punto fijo; Newton; puntos
crı́ticos de funciones reales de variable real; calculadora; casio fx82-es.
1.
Introducción
Son numerosas las situaciones en las que uno tiene que resolver una ecuación no lineal, que es aquella
en la que no se puede despejar la variable independiente en términos de una expresión que no dependa de
ella; las ecuaciones algebraicas (para calcular raı́ces de polinomios) de grado mayor que cuatro son casos
particulares, y la búsqueda de puntos crı́ticos de una función real de variable real puede hacerse con dichas
técnicas. De hecho, en el mundo ingenieril es frecuente tener que calcular los ceros y los polos de la función
de transferencia de un circuito, que es una función racional (i.e., un cociente de polinomios): los ceros son las
raı́ces del numerador, y los polos las del denominador [5, p. 315, p. 157]. También tenemos que resolver una
ecuación no lineal cuando queremos ajustar la resistencia de un potenciómetro para disipación de energı́a, o
cuando queremos determinar la frecuencia angular para que la impedancia en un circuito RLC en paralelo
tenga cierto valor predeterminado o sea la máxima posible, por citar sólo un par de situaciones tomadas de
[6, p. 742].
A lo largo de este artı́culo ilustraremos varias técnicas iterativas para tratar el caso particular más básico,
en el cual tenemos que resolver una ecuación algebraica de tercer grado que tomamos de [1, §2]. A pesar
de su simplicidad, este caso nos permitirá utilizar la misma ecuación no lineal por todo el artı́culo, dejando
otras ecuaciones no lineales para las secciones de ejercicios y evaluación. Se trata de construir una sucesión
{xn ∈ R} cuyo lı́mite sea la raı́z x∗ ∈ R de
f (x) = x3 + 4x2 − 10 = 0.
Hay calculadoras hoy dı́a, como la casio fx570-es [3], que disponen de un modo eqn para resolver ecuaciones algebraicas de hasta tercer grado, y de una tecla solve para tratar con las de grado superior o con
ecuaciones no lineales en general. El reto que nos planteamos aquı́ es abordar dichos problemas en una
calculadora como la casio fx82-es [2], que no dispone ni de tecla solve ni de modo eqn.
*
Inf. Técnico MA-11/01 (http://www.matap.uma.es/investigacion/tr.html), Dept. Matemática Aplicada, Univ. Málaga, 20
de noviembre de 2011. Este trabajo constituye la actividad final obligatoria del autor para el curso Thales/CICA “La calculadora
cientı́fica como recurso didáctico en el Área de Matemáticas” (MAT11-07-CALCIE) desarrollado a través de su plataforma virtual
del 17 de octubre al 18 de diciembre de 2011.
1
Actividad Final
Pablo Guerrero García <[email protected]>
20/11/2011, Page 2 of 5
A modo de apéndice de este artı́culo hemos incluido las secuencias de teclas que hay que pulsar para
resolver los cuatro ejemplos E1 – E4 de las secciones 2–4, sus capturas de pantalla correspondientes, ası́ como las secuencias de teclas que hay que pulsar para resolver los ejercicios E1 – E4 planteados al alumno
en la sección 5, también con sus capturas de pantalla correspondientes. Se recomienda encarecidamente al
alumno que reproduzca los ejemplos y contraste las soluciones a los ejercicios con sus propias soluciones
para ser capaz de abordar con éxito las actividades de evaluación E1 – E4 incluidas en la sección 6.
2.
Método de bipartición
Este método es un método lento pero seguro: encontrado un intervalo [a, b] en el que f ∈ C[a, b] sea tal que
f (a)f (b) < 0, el teorema de Bolzano nos garantiza la existencia de al menos una raı́z x∗ tal que f (x∗ ) = 0.
De hecho, la demostración del mismo constituye el conocido método de bipartición (o bisección), en el que
se trata de generar una sucesión de intervalos [an , bn ] cada vez más pequeños en todos los cuales podamos
garantizar que está x∗ . Considerando el punto de iteración xn+1 como el punto medio de dicho intervalo, si
f (an )f (xn+1 ) > 0 se restringe el extremo izquierdo del intervalo tomando an+1 = xn+1 y bn+1 = bn , y si no
se restringe el derecho tomando an+1 = an y bn+1 = xn+1 , repitiéndose el proceso.
E1 Una vez determinado con el modo table que en [a0 , b0 ] = [1, 2] debe haber una raı́z al apreciarse
un cambio de signo al evaluar f , se trata de realizar 5 iteraciones del método de bipartición. En este caso
trabajaremos en aritmética de 10 dı́gitos, que es la que tiene por defecto la casio fx82-es. Además de usar
las variables a, b y x para el extremo izquierdo, el extremo derecho y el punto de iteración (respectivamente),
usamos por eficiencia c, d e y para los correspondientes valores de f . Se observa que en las iteraciones
primera y tercera fue el extremo derecho del intervalo el que restringimos, y en las demás fue el izquierdo.
La aproximación obtenida para x∗ es x5 ≈ 1.34375, pero f (x5 ) ≈ −0.3510 6= 0 con lo cual intuimos que aún
estamos muy lejos de x∗ .
El método de bipartición es el más básico de la familia conocida como métodos de intervalos encajados,
que intentan acelerar el proceso descrito anteriormente pero manteniendo la garantı́a de terminación del
proceso. En lugar de ahondar en los mismos pasaremos a describir otro tipo de métodos más rápidamente
convergentes, pues la utilidad de los métodos de intervalos encajados es precisamente facilitar un buen punto
de partida para los más rápidos y para ello el de bipartición nos puede bastar. Se recomienda al alumno que
resuelva el ejercicio E1 .
3.
Métodos de aproximaciones sucesivas
Un método de aproximaciones sucesivas (MAS), también conocido como iteración de punto fijo, se basa
en reescribir primero la ecuación no lineal f (x) = 0 como x = g(x), para después plantear el método iterativo
que, partiendo de un cierto x0 ∈ R, construye la sucesión {xn ∈ R} mediante xn+1 = g(xn ) con la esperanza
de que converja a un punto fijo x∗ de g, que es un valor x∗ tal que x∗ = g(x∗ ), que supondremos por
consistencia que también es raı́z de f (i.e., que f (x∗ ) = 0).
A pesar de la simplicidad del caso que nos ocupa, tenemos múltiples posibilidades para reescribir f (x) = 0
como x = g(x), entre las cuales están (cf. [1, §2.2]):
(a) Sumando x a ambos lados y despejando la x de más a la izquierda:
x + x3 + 4x2 − 10 = x
x = x − x3 − 4x2 + 10 = ga (x)
(b) Despejando x3 , dividiendo por x, elevando a 1/2 en ambos lados y tomando signo positivo:
r
10
10
3
2
2
x = −4x + 10
x =
− 4x
x=+
− 4x = gb (x)
x
x
(c) Aislando el 10, sacando factor común x2 , despejando x2 , elevando a 1/2 y tomando signo positivo:
r
10
10
3
2
2
2
x + 4x = x (x + 4) = 10
x =
x=+
= gc (x)
x+4
x+4
Actividad Final
Pablo Guerrero García <[email protected]>
20/11/2011, Page 3 of 5
(d) Despejando x2 , elevando a 1/2 en ambos lados y tomando signo positivo:
√
+ 10 − x3
10 − x3
2
x=
= gd (x)
x =
4
2
(e) También puede reescribirse ası́:
x3 + 4x2 − 10 = 0
=
3x3 + 8x2 = x(3x2 + 8x) = 2x3 + 4x2 + 10
x=
2x3 + 4x2 + 10
=
3x2 + 8x
3x3 + 8x2 − x3 − 4x2 + 10
3x3 + 8x2 x3 + 4x2 − 10
x3 + 4x2 − 10
=
−
=
x
−
= ge (x)
3x2 + 8x
3x2 + 8x
3x2 + 8x
3x2 + 8x
En esta sección y en la siguiente nos ocuparemos de las dos últimas, dejando las tres primeras como ejercicio
E2 para el alumno tras presentarle el siguiente ejemplo, que ya aparecı́a en [5, p. 311, p. 153]. Sin que ello
lleve a confusión, seguiremos usando g cuando hagamos referencia a gd en esta sección o a ge en la siguiente.
E2 Ahora vamos a trabajar en aritmética de 7 dı́gitos, lo cual establecemos en la calculadora poniendo sci
a 7. También es conveniente seleccionar lineio para no andar con fracciones (como harı́a mathio) a la hora
de mostrar el punto de iteración que se lleva almacenado en la variable x. Como queremos quedarnos con 7
dı́gitos significativos redondeados tras cada iteración, el uso de rnd precede a la llamada a g, y el resultado
convenientemente redondeado se asigna nuevamente en x para poder repetir el proceso simplemente dándole
a la tecla =. Conseguimos convergencia tras 20 iteraciones ya que x20 = x19 ≈ 1.365230, obteniendo una
aproximación con 7 dı́gitos significativos redondeados correctos al x∗ tal que f (x∗ ) = 0.
En este caso hemos tenido suerte y hemos conseguido convergencia, pero no siempre tiene por qué ser ası́.
Afortunadamente se dispone de un teorema de condición suficiente, conocido como teorema del punto fijo,
que establece que si se dan las tres condiciones siguientes
g ∈ C 1 [a, b]
y
∀x ∈ [a, b], g(x) ∈ [a, b]
y
∀x ∈ [a, b], |g 0 (x)| ≤ L < 1,
entonces podemos garantizar que la sucesión {xn ∈ R} construida mediante xn+1 = g(xn ) converge, empezando de cualquier x0 ∈ [a, b] (lo que se conoce como convergencia global en dicho intervalo), a un único
punto fijo x∗ ∈ [a, b] de g. Obsérvese que la función que tiene que verificar dichas condiciones es g (no f ),
que el intervalo tiene que ser cerrado, que la primera condición es que g sea continua y con derivada continua
en [a, b], que la segunda condición se lee “g manda de [a, b] a [a, b]”, que en la tercera condición se acota |g 0 |
(no g 0 ), y que si no se verifican esas tres condiciones no podemos concluir nada.
E3 Al igual que en [4, p. 118b], vamos a determinar un intervalo cerrado en el que podamos garantizar
la convergencia global para el MAS del ejemplo anterior. El modo table nos viene bien en este caso para
comprobar primero que 10 − x3 ni toma valores negativos ni se anula en [1, 2], lo cual comprometerı́a la
condición de que g ∈ C 1 [1, 2] al aparecer dicho término dentro de la raı́z en g y en el denominador de g 0 .
Una vez que editamos la expresión anterior para que aparezca g(x) = (1/2)(10
− x3 )1/2 en el modo table,
√
vemos que no se tiene que g mande de [1, 2] a [1, 2], puesto que g(2) = 2/2 ≈ 0.7071 < 1 y por ello no
podemos garantizar la convergencia global en [1, 2]. Sin embargo, considerando [1, 1.5] sı́: tenemos que editar
la expresión anterior para que aparezca g 0 (x) en el modo table, y comprobamos que
1
∀x ∈ [1, 1.5] , g 0 (x) = (10 − x3 )−1/2 (−3x2 ) < 0
4
lo cual implica,pal ser g(x) continua en [1, 1.5], que g(x) es decreciente en dicho intervalo; como g(1) = 1.5 y
g(1.5) = (1/4) 53/2 ≈ 1.287 > 1, se concluye que g manda de [1, 1.5] a [1, 1.5]. Para acotar |g 0 (x)| en dicho
intervalo, observamos que
1
1
∀x ∈ [1, 1.5] , g 00 (x) = (10 − x3 )−1/2 (−6x) − (10 − x3 )−3/2 (−3x2 )2 < 0
4
8
0
0
lo cual implica, al ser g (x) continua en [1, 1.5], que g (x) es decreciente en dicho intervalo, con lo cual |g 0 (x)|
será creciente y estará acotada en dicho intervalo por |g 0 (1.5)| ≈ | − 0.6556| ≤ 0.66 = L < 1. Por todo ello
podemos garantizar la convergencia global en [1, 1.5]: de hecho, en el ejemplo E2 empezamos en x0 = 1.5
y hubo convergencia.
Antes de proceder a la última sección de contenidos, se recomienda al alumno que resuelva el ejercicio E3 .
Actividad Final
4.
Pablo Guerrero García <[email protected]>
20/11/2011, Page 4 of 5
Método de Newton
El método de Newton es un MAS en el que g(x) = x − f (x)/f 0 (x). La opción (e) de la sección anterior
corresponde a dicha elección, y se trata de un método muy rápido siempre y cuando estemos suficientemente
cerca de la raı́z, lo que se conoce como convergencia local. Dicho en otras palabras, todo lo que podemos
asegurar es que existe un δ > 0 tal que dicho MAS converge globalmente en [x∗ − δ, x∗ + δ] ⊂ [a, b]; ahora
bien, cuando hay convergencia va a ser muy rápida, como ilustraremos en nuestro último ejemplo.
E4 Se trata de aplicar el método de Newton empezando de x0 = 1.5 para resolver la ecuación no lineal
que tenemos entre manos. En este caso también vamos a trabajar en aritmética de 7 dı́gitos, con lo cual al
principio procedemos como en el ejemplo E2 y luego tecleamos x − f (x)/f 0 (x) como g(x) en vez de la g(x)
que usamos en dicho ejemplo. Aunque podı́amos haber simplificado algo la expresión de g(x) (lo cual es
muchas veces conveniente, por ejemplo en las actividades de evaluación de la sección 6), la hemos tecleado
tal cual por claridad. Conseguimos convergencia tras sólo 4 iteraciones (en el ejemplo E2 necesitamos 20)
ya que x4 = x3 ≈ 1.365230, obteniendo una aproximación con 7 dı́gitos significativos redondeados correctos
al x∗ tal que f (x∗ ) = 0.
Ahora es buen momento para que el alumno resuelva el ejercicio E4 . Acabaremos advirtiendo al alumno
que el método de Newton no es la panacea: puede quedarse estancado debido a simetrı́as de la función, o
presentar dificultades numéricas cuando la derivada en el punto de iteración sea casi nula. Es una de las
razones por las que es conveniente conocer la teorı́a general de los métodos de aproximaciones sucesivas.
Por otra parte, las técnicas descritas pueden emplearse para calcular puntos crı́ticos de una función real
de variable real, pues la condición de optimalidad de primer orden conlleva resolver la ecuación no lineal
planteada al imponer que la derivada de dicha función se anule. Este tipo de situaciones las contemplaremos
en las actividades de evaluación E1 – E4 .
5.
Ejercicios
En esta sección recopilamos los ejercicios a los que se ha hecho alusión en las secciones precedentes. Se
recomienda al alumno que, siguiendo la metodologı́a de los ejemplos, los intente por sı́ mismo y contraste
sus propias soluciones con las soluciones a los mismos que facilitamos a modo de apéndice.
E1 Trabajando en aritmética de 10 dı́gitos, realiza 5 iteraciones del método de bipartición para encontrar
una raı́z de f (x) = x − cos(x) = 0.
E2 Trabajando en aritmética de 7 dı́gitos, realiza iteraciones de punto fijo empezando con x0 = 1.5 para
intentar encontrar un punto fijo de
(a) ga (x) = x − x3 − 4x2 + 10
r
10
− 4x
(b) gb (x) = +
x
r
10
(c) gc (x) = +
4+x
Comenta los resultados obtenidos, en relación con los del ejemplo E2 .
E3 Determina un intervalo en el que puedas garantizar la convergencia global del MAS con g(x) = cos(x)
para resolver la ecuación no lineal del ejercicio E1 .
E4 Para resolver la ecuación no lineal del ejercicio E1 , compara el número de iteraciones que necesita
el MAS del ejercicio E3 con el número de iteraciones que necesita el método de Newton, empezando en
ambos casos desde el punto medio del intervalo determinado en dicho ejercicio y utilizando aritmética de 6
dı́gitos. Aplica el que veas más rápidamente convergente también usando aritmética de 10 dı́gitos.
Actividad Final
6.
Pablo Guerrero García <[email protected]>
20/11/2011, Page 5 of 5
Evaluación
Finalmente, incluimos en esta sección los problemas relevantes de las convocatorias de junio y septiembre
de 2011 de las asignaturas “Estadı́stica y Métodos Numéricos” y “Matemáticas 4” correspondientes al
segundo cuatrimestre del primer curso de los nuevos grados en Ingenierı́a de Telecomunicaciones de la
Universidad de Málaga. Es de resaltar que todos ellos pueden abordarse con las técnicas aquı́ descritas:
de hecho, durante el curso y por supuesto a la hora de evaluarse, el alumno puede (y debe) utilizar una
calculadora que no supere en prestaciones a la casio fx570-es.
E1 Empezando en x0 = 0, calcula con 2 decimales correctos una raı́z real de la ecuación no lineal
f (x) = x3 − 2x − 2 = 0 con el método de Newton y con el de aproximaciones sucesivas xk+1 = g(xk ), siendo
1
g(x) = (−x3 + 9x − 2),
7
y encuentra un intervalo cerrado entre dos enteros consecutivos en el que puedas garantizar la convergencia
global de alguno de esos métodos a dicha raı́z real.
E2 Con x0 = 0, calcula con 2 decimales correctos un punto crı́tico de x4 /4 − x2 − 2x en [−2, 2] con el
método de Newton y con el de aproximaciones sucesivas xk+1 = g(xk ), siendo
1
g(x) = (−x3 + 10x + 2),
8
y encuentra un intervalo cerrado entre dos enteros consecutivos en el que puedas garantizar la convergencia
global de alguno de esos métodos a dicho punto crı́tico.
E3 Partiendo de x0 = 2, calcula con 2 decimales correctos una raı́z de f (x) = 0 en [0, 2] realizando
6 iteraciones en aritmética de 4 dı́gitos con el método de Newton y con el de aproximaciones sucesivas
xk+1 = g(xk ), siendo
√
2f (x)
f (x) = 3 x − 1
y
g(x) = x − 0
,
5f (x)
y estudia si en dicho intervalo cerrado puedes garantizar la convergencia global de alguno de esos métodos. E4 Partiendo de x0 = 2, calcula con 2 decimales correctos una raı́z de f (x) = 0 en [0, 2] realizando
7 iteraciones en aritmética de 5 dı́gitos con el método de Newton y con el de aproximaciones sucesivas
xk+1 = g(xk ), siendo
√
f (x)
f (x) = 3 ex − 1
y
g(x) = x − 0
,
3f (x)
y estudia si en dicho intervalo cerrado puedes garantizar la convergencia global de alguno de esos métodos. Referencias
[1] Richard L. Burden and J. Douglas Faires. Numerical Analysis, 8th edition. International Thomson
Publishing, Belmont (CA, USA), 2005.
[2] CASIO. FX-82ES User’s Guide. Casio, 2004.
[3] CASIO. FX-570ES User’s Guide. Casio, 2004.
[4] Pablo Guerrero-Garcı́a. Slides for a Course on Numerical Methods (Spanish). Dpto. Matemática Aplicada, Universidad de Málaga, December 2003.
[5] Pablo Guerrero-Garcı́a and Ángel Santos-Palomo. Squeezing the most out of the CASIO FX-570MS for
electrical/electronics engineers. Proc. CMMSE 2008 (vol. 1, ISBN 9788461219827), pp. 307–322, 2008.
Spanish translation for Epsilon-Revista Educación Matemática, vol. 27(3), núm. 76, pp. 149–164, 2010.
[6] Pablo Guerrero-Garcı́a and Ángel Santos-Palomo. Motivational numerical examples for electrical/electronics engineers. Proc. APLIMAT 2010 (ISBN 9788089313471), pp. 739–747, 2010. Both English
and Spanish versions available at http://www.matap.uma.es/investigacion/tr/ma06 01r.pdf
Keystrokes for Examples - Final Activity
Pablo Guerrero García <[email protected]>
18/11/2011, Page 1 of 1
Example 1
w3Q)D+4Q)d-10p
-3p3ppRRRRRRw1qw2
1qJzMD+4Md-10qJc
2qJxE!oqJj
(Qz+Qx)P2qJ)E!oqJn
QcQnpQ)qJxQnqJj
EEEEpEEEEpEEEEp
EEEE!oqJzEEEE!oqJc
EEEEpEEEEpEEEEp
EEEEEEEEEpEEEEEEEEEp
EEEEpEEEEpEEEEp
EEEEEEEEEpEEEEEEEEEp
EEEEpEEEEpEEEEp
EEEEpEEEEp
Example 2
qw2qw771.5qJ)
q0s10-Q)D)P2)qJ)
ppppppppppppppppppp
Example 3
w310-Q)Dpp20.1p
RRRRRRRRRR
Ca1R2$($$$$$$$)^1P2pppp
RRRRRRRRRR
Cpp1.5pp$RRRRR
C-$$o3Q)dR$o4
$$$$$$$$$$$-$pppp$RRRRR
C$$$$$$ooR$o2
$$$$$$$$$$$$$$$$
-a(3Q)d)dR8$
(10-Q)D)^-3P2pppp$RRRRR
Example 4
qw2qw771.5qJ)
q0Q)-(Q)D+4Q)d-10)P
(3Q)d+8Q)))qJ)
ppp
Examples #1 and #2 - Final Activity
Pablo Guerrero García <[email protected]>
18/11/2011, Page 1 of 2
Examples #1 and #2 - Final Activity
Pablo Guerrero García <[email protected]>
18/11/2011, Page 2 of 2
Examples #3 and 4 - Final Activity
Pablo Guerrero García <[email protected]>
18/11/2011, Page 1 of 2
Examples #3 and 4 - Final Activity
Pablo Guerrero García <[email protected]>
18/11/2011, Page 2 of 2
Keystrokes for Exercises - Final Activity
Pablo Guerrero García <[email protected]>
Exercise 1
qw4w3Q)-kQ))p-qKp
qKpqKP2p$RRRRRw1qw2
0qJzM-kM)qJc
qKP2qJxE!oqJj
(Qz+Qx)P2qJ)E!oqJn
QcQnpQ)qJxQnqJj
EEEEpEEEEpEEEEp
EEEE!oqJzEEEE!oqJc
EEEEpEEEEpEEEEp
EEEEpEEEEp
EEEEpEEEEpEEEEp
EEEEpEEEEp
EEEEpEEEEpEEEEp
EEEEpEEEEp
Exercise 2.a
qw2qw771.5qJ)
q0Q)-Q)D-4Q)d+10)qJ)
pppppp
Exercise 2.b
qw2qw771.5qJ)
q0s10PQ)-4Q)))qJ)pp
Exercise 2.c
qw2qw771.5qJ)
q0s10P(4+Q))))qJ)
ppppppp
Exercise 3
qw4w3kQ))p
0pqKP2pqKP8p$RRRR
C-$ojpppp$RRRR
Cpp1p.2p$RRRRR
C$$okpppp$RRRRR
C$opppp$RRRRR
Exercise 4.a
qw4qw2qw76.5qJ)
q0kQ)))qJ)
pppppppppppppppp
pppppppppppppppp
Exercise 4.b
qw4qw2qw76.5qJ)
q0Q)-(Q)-kQ)))P
(1+jQ))))qJ)ppp
qw81EEEEpEppppp
19/11/2011, Page 1 of 1
Exercises #1 and #2 - Final Activity
Pablo Guerrero García <[email protected]>
19/11/2011, Page 1 of 2
Exercises #1 and #2 - Final Activity
Pablo Guerrero García <[email protected]>
19/11/2011, Page 2 of 2
Exercises #3 and #4 - Final Activity
Pablo Guerrero García <[email protected]>
19/11/2011, Page 1 of 3
Exercises #3 and #4 - Final Activity
Pablo Guerrero García <[email protected]>
19/11/2011, Page 2 of 3
Exercises #3 and #4 - Final Activity
Pablo Guerrero García <[email protected]>
19/11/2011, Page 3 of 3