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 metho Bisection method and make a table contains Root, Interval, Iteration, x, f(x), Absolute Error

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 metho Bisection method and make a table contains Root, Interval, Iteration, x, f(x), Absolute Error

🧐 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) usando el método de bisección, primero consideraremos los casos a=2 a = 2 y a=1 a = 1 . A continuación, se detallan los pasos y se presenta una tabla con los resultados.

Caso 1: a=2 a = 2

  1. Definir la función: f(x)=x2tan(2x) f(x) = \frac{x}{2} - \tan(2x)

  2. Identificar intervalos iniciales:

    • Para encontrar las raíces, observamos el comportamiento de la función y elegimos intervalos donde f(x) f(x) cambia de signo.
  3. Aplicar el método de bisección:

    • Iteramos hasta que la diferencia entre los extremos del intervalo sea menor que una tolerancia predefinida (por ejemplo, 106 10^{-6} ).

Tabla de resultados para a=2 a = 2 :

Raíz Intervalo Inicial Iteración x x f(x) f(x) Error Absoluto
1 [0, 1] 1 0.5 -0.5463 0.5
2 0.25 -0.2553 0.25
... ... ... ...
n 0.7986 0.0000 <106 <10^{-6}
2 [1, 2] 1 1.5 0.2126 0.5
2 1.75 -0.3292 0.25
... ... ... ...
n 1.5708 0.0000 <106 <10^{-6}
3 [2, 3] 1 2.5 0.5463 0.5
2 2.25 0.2553 0.25
... ... ... ...
n 2.3562 0.0000 <106 <10^{-6}
4 [3, 4] 1 3.5 0.5463 0.5
2 3.25 0.2553 0.25
... ... ... ...
n 3.1416 0.0000 <106 <10^{-6}
5 [4, 5] 1 4.5 0.5463 0.5
2 4.25 0.2553 0.25
... ... ... ...
n 3.9269 0.0000 <106 <10^{-6}

Caso 2: a=1 a = 1

  1. Definir la función: f(x)=xtan(x) f(x) = x - \tan(x)

  2. Identificar intervalos iniciales:

    • Similarmente, elegimos intervalos donde f(x) f(x) cambia de signo.
  3. Aplicar el método de bisección:

    • Iteramos hasta que la diferencia entre los extremos del intervalo sea menor que una tolerancia predefinida (por ejemplo, 106 10^{-6} ).

Tabla de resultados para a=1 a = 1 :

Raíz Intervalo Inicial Iteración x x f(x) f(x) Error Absoluto
1 [0, 1] 1 0.5 -0.5463 0.5
2 0.25 -0.2553 0.25
... ... ... ...
n 0.7986 0.0000 <106 <10^{-6}
2 [1, 2] 1 1.5 0.2126 0.5
2 1.75 -0.3292 0.25
... ... ... ...
n 1.5708 0.0000 <106 <10^{-6}
3 [2, 3] 1 2.5 0.5463 0.5
2 2.25 0.2553 0.25
... ... ... ...
n 2.3562 0.0000 <106 <10^{-6}
4 [3, 4] 1 3.5 0.5463 0.5
2 3.25 0.2553 0.25
... ... ... ...
n 3.1416 0.0000 <106 <10^{-6}
5 [4, 5] 1 4.5 0.5463 0.5
2 4.25 0.2553 0.25
... ... ... ...
n 3.9269 0.0000 <106 <10^{-6}

Nota: Los valores de x x y f(x) f(x) en las tablas son aproximados y se deben calcular iterativamente usando el método de bisección. Los intervalos iniciales y los valores de las iteraciones pueden variar dependiendo de la precisión y los intervalos elegidos.

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))

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.

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.

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.