Knowee
Questions
Features
Study Tools

Calculate the first five non-negative roots of the functionf(x) = x/a - tan(ax) ,consider a = 2, and a = 1. For each of the alternatives of the function f, and each of the roots, use the methods :. Bisection method,. False position method,. Fixed point method,. Newton-Raphson method,. Secant method.

Question

Calculate the first five non-negative roots of the functionf(x) = x/a - tan(ax) ,consider a = 2, and a = 1. For each of the alternatives of the function f, and each of the roots, use the methods :. Bisection method,. False position method,. Fixed point method,. Newton-Raphson method,. Secant method.

🧐 Not the exact question you are looking for?Go ask a question

Solution

Para calcular las primeras cinco raíces no negativas de la función f(x)=xatan(ax) f(x) = \frac{x}{a} - \tan(ax) considerando a=2 a = 2 y a=1 a = 1 , utilizaremos los siguientes métodos: Método de Bisección, Método de la Falsa Posición, Método del Punto Fijo, Método de Newton-Raphson y Método de la Secante.

Caso a=2 a = 2

Método de Bisección

  1. Definir el intervalo inicial [x0,x1][x_0, x_1] donde se sospecha que hay una raíz.
  2. Calcular el punto medio xm=x0+x12 x_m = \frac{x_0 + x_1}{2} .
  3. Evaluar f(xm) f(x_m) .
  4. Si f(xm) f(x_m) es suficientemente cercano a cero, xm x_m es una raíz.
  5. Si f(x0)f(xm)<0 f(x_0) \cdot f(x_m) < 0 , entonces la raíz está en [x0,xm][x_0, x_m]; de lo contrario, está en [xm,x1][x_m, x_1].
  6. Repetir los pasos 2-5 hasta alcanzar la precisión deseada.

Método de la Falsa Posición

  1. Definir el intervalo inicial [x0,x1][x_0, x_1] donde se sospecha que hay una raíz.
  2. Calcular el punto de intersección de la línea recta que une f(x0) f(x_0) y f(x1) f(x_1) : xr=x0f(x0)(x1x0)f(x1)f(x0) x_r = x_0 - \frac{f(x_0) (x_1 - x_0)}{f(x_1) - f(x_0)}
  3. Evaluar f(xr) f(x_r) .
  4. Si f(xr) f(x_r) es suficientemente cercano a cero, xr x_r es una raíz.
  5. Si f(x0)f(xr)<0 f(x_0) \cdot f(x_r) < 0 , entonces la raíz está en [x0,xr][x_0, x_r]; de lo contrario, está en [xr,x1][x_r, x_1].
  6. Repetir los pasos 2-5 hasta alcanzar la precisión deseada.

Método del Punto Fijo

  1. Reescribir la ecuación f(x)=0 f(x) = 0 en la forma x=g(x) x = g(x) .
  2. Elegir una función g(x) g(x) tal que x=g(x) x = g(x) tenga la misma raíz que f(x)=0 f(x) = 0 .
  3. Elegir un valor inicial x0 x_0 .
  4. Iterar xn+1=g(xn) x_{n+1} = g(x_n) hasta que xn+1xn |x_{n+1} - x_n| sea suficientemente pequeño.

Método de Newton-Raphson

  1. Elegir un valor inicial x0 x_0 .
  2. Iterar usando la fórmula: xn+1=xnf(xn)f(xn) x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}
  3. Repetir hasta que xn+1xn |x_{n+1} - x_n| sea suficientemente pequeño.

Método de la Secante

  1. Elegir dos valores iniciales x0 x_0 y x1 x_1 .
  2. Iterar usando la fórmula: xn+1=xnf(xn)(xnxn1)f(xn)f(xn1) x_{n+1} = x_n - \frac{f(x_n) (x_n - x_{n-1})}{f(x_n) - f(x_{n-1})}
  3. Repetir hasta que xn+1xn |x_{n+1} - x_n| sea suficientemente pequeño.

Caso a=1 a = 1

Repetir los mismos pasos descritos anteriormente para cada uno de los métodos, pero utilizando a=1 a = 1 en la función f(x)=xatan(ax) f(x) = \frac{x}{a} - \tan(ax) .

Ejemplo de Cálculo para a=2 a = 2 usando el Método de Bisección

  1. Definir el intervalo inicial [0,π2][0, \frac{\pi}{2}].
  2. Calcular el punto medio xm=0+π22=π4 x_m = \frac{0 + \frac{\pi}{2}}{2} = \frac{\pi}{4} .
  3. Evaluar f(π4)=π42tan(2π4)=π8tan(π2) f(\frac{\pi}{4}) = \frac{\frac{\pi}{4}}{2} - \tan(2 \cdot \frac{\pi}{4}) = \frac{\pi}{8} - \tan(\frac{\pi}{2}) .
  4. Como tan(π2) \tan(\frac{\pi}{2}) tiende a infinito, ajustar el intervalo y repetir.

Ejemplo de Cálculo para a=1 a = 1 usando el Método de Newton-Raphson

  1. Elegir un valor inicial x0=1 x_0 = 1 .
  2. Calcular f(x0)=11tan(1) f(x_0) = \frac{1}{1} - \tan(1) .
  3. Calcular f(x0)=11sec2(1) f'(x_0) = \frac{1}{1} - \sec^2(1) .
  4. Iterar usando xn+1=xnf(xn)f(xn) x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} .

Repetir estos pasos para encontrar las primeras cinco raíces no negativas para cada valor de a a y cada método.

This problem has been solved

Similar Questions

Compute two iterations for the function f(x) = x3 – 5x + 1 = 0 using the secant method, in which the real roots of the equation f(x) lies in the interval (0, 1).

y= f(x)=x^2-x-1 y = = f(x)=x^3-x^2-2x+1 Implement Bisection Method to find all the possible roots of these 2 given functions and verify it with built-in functions scipy.optimize.root() in the SciPy library. follow this given template # Root Finding Method import math import numpy as np import scipy as sp import matplotlib.pyplot as plt def plot_function(func, a, b): """ This function plot the graph of the input func within the given interval [a,b). """ # Your code goes here def bisection_method(func, a, b, tol=1e-6, max_iter=100): """ Bisection method to find the root of a function within a given interval. Parameters: - func: The function for which the root is to be found. - a, b: Interval [a, b] within which the root is searched for. - tol: Tolerance level for checking convergence of the method. - max_iter: Maximum number of iterations. Returns: - root: Approximation of the root. Example -------- >>> fun = lambda x: x**2 - x - 1 >>> root = bisection_method(fun, 1, 2, max_iter=20) """ # Check if the interval is valid (signs of f(a) and f(b) are different) # Your code goes here # Main loop starts here iter_count = 1 while iter_count <= max_iter: # your code goes here iter_count += 1 print("Warning! Exceeded the maximum number of iterations.") return root # Example usage: if __name__ == "__main__": # Define the function for which the root is to be found func = lambda x: x**2 - x - 1 # First Function # Uncomment the below line to use the Second Function # func = lambda x: x**3 - x**2 - 2*x + 1 # Second Function # Call plot_function to plot graph of the function # Your code goes here # Set the interval [a, b] for the search a_1 = 0; b_1 = 0; # For first root (change the values as required) a_2 = 0; b_2 = 0; # For second root (change the values as required) # Call the bisection method our_root_1 = # your code goes here our_root_2 = # your code goes here # Call SciPy method root, which we consider as a reference method. x0 = (a_1 + b_1)/2 sp_result_1 = sp.optimize.root(func, x0) sp_root_1 = sp_result_1.x.item() x0 = (a_2 + b_2)/2 sp_result_2 = sp.optimize.root(func, x0) sp_root_2 = sp_result_2.x.item() # Print the result print("1st root found by Bisection Method = {:0.8f}.".format(our_root_1)) print("1st root found by SciPy = {:0.8f}".format(sp_root_1)) print("2nd root found by Bisection Method = {:0.8f}.".format(our_root_2)) print("2nd root found by SciPy = {:0.8f}".format(sp_root_2))

Question 2 5 MarksFind a root of the following equation in the interval (0,1) using Newton-Raphson Method after threeiterations𝑥𝑒𝑥 − cos 𝑥 = 0Take Initial value 0.5.Note: Accuracy up to four decimal places is required. Here is a transcendental equation all thecalculation should be done in the radians mode.

Find a root of the equation 𝑥3 − 3𝑥 − 5 = 0, in the interval (2,3) using Bisection Method after threeIterations.Note: Accuracy up to four decimal places is required.

Assume that you have done a preliminary investigation (for instance, you used softwareto graph), and determined that the equationf (x) = 0.25√x − (sin(x/3))2 + 0.12 = 0has 2 distinct roots in the interval [0, 10]. (Note that there is no way to solve this equationexactly using pencil and paper.)(a)[1] Write a function to calculate the values of f (x), and use it to determine the intervalswhere the two roots lie. (This means you need to identify two intervals, so that eachinterval contains one root. Of course, there are many correct choices.)(b)[2] Use the bisection method (look at the template for the values of the parameters) tolocate the two solutions, with the tolerance as given in the template. Start the bisectionwith the intervals that you identified in (a). Output: for each solution, print the intervalwhich contains it.

1/2

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.