Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Consider a function a follows: f = x^5 - 13x^3 - x^2 + 10x + 170 .Visualize the roots using Gerschgorin-Circle. Include a plot of the function itself, complete with labels and title in your report.in sage math notebook jupyter

from sympy import symbols, Poly, solve from sympy.plotting import plot

Define the function f and the variable x

x = symbols('x') f = x5 - 13x3 - x2 + 10x + 170

Convert f to a polynomial

f_poly = Poly(f, x)

Find all the roots

roots = solve(f_poly, domain='CC')

Print all roots

print("All roots:") for root in roots: root_approx = root.evalf() print(root_approx)

Filter real and complex roots

real_roots = [root for root in roots if root.is_real] complex_roots = [root for root in roots if not root.is_real]

Print real roots

print("Real roots:") for root in real_roots: root_approx = root.evalf() print(root_approx)

Print complex roots

print("Complex roots:") for root in complex_roots: root_approx = root.evalf() print(root_approx)

Print the number of real roots

num_real_roots = len(real_roots) print("Number of real roots:", num_real_roots)

Plot the real part of the function f

p1 = plot(f, (x, -5, 5), title='Graph of f(x)', real=True) help for Gerschgorin-Circle

Consider a function a follows: f = x^5 - 13x^3 - x^2 + 10x + 170 .Visualize the roots using Gerschgorin-Circle. Include a plot of the function itself, complete with labels and title in your report.in sage math notebook jupyter

from sympy import symbols, Poly, solve from sympy.plotting import plot

# Define the function f and the variable x

x x = symbols('x') f = x5 - 13x3 - x2 + 10x + 170

x**5 - 13*x**3 - x**2 + 10*x + 170 # Convert f to a polynomial

polynomial f_poly = Poly(f, x)

x) # Find all the roots

roots roots = solve(f_poly, domain='CC')

domain='CC') # Print all roots

roots print("All roots:") for root in roots: root_approx = root.evalf() print(root_approx)

print(root_approx) # Filter real and complex roots

roots real_roots = [root for root in roots if root.is_real] complex_roots = [root for root in roots if not root.is_real]

Print real roots

root.is_real] # Print real roots print("Real roots:") for root in real_roots: root_approx = root.evalf() print(root_approx)

print(root_approx) # Print complex roots

roots print("Complex roots:") for root in complex_roots: root_approx = root.evalf() print(root_approx)

print(root_approx) # Print the number of real roots

roots num_real_roots = len(real_roots) print("Number of real roots:", num_real_roots)

num_real_roots) # Plot the real part of the function f

f p1 = plot(f, (x, -5, 5), title='Graph of f(x)', real=True)

help for Gerschgorin-Circle

Consider a function a follows: f = x^5 - 13x^3 - x^2 + 10x + 170 .Visualize the roots using Gerschgorin-Circle. Include a plot of the function itself, complete with labels and title in your report.in sage math notebook jupyter

help for Gerschgorin-Circle

from sympy import symbols, Poly, solve
 from sympy.plotting import plot

plot

# Define the function f and the variable x
x = symbols('x')
f = x**5 - 13*x**3 - x**2 + 10*x + 170

# Convert f to a polynomial
f_poly = Poly(f, x)

# Find all the roots
roots = solve(f_poly, domain='CC')

# Print all roots
print("All roots:")
for root in roots:
    root_approx = root.evalf()
    print(root_approx)

# Filter real and complex roots
real_roots = [root for root in roots if root.is_real]
complex_roots = [root for root in roots if not root.is_real]

# Print real roots
print("Real roots:")
for root in real_roots:
    root_approx = root.evalf()
    print(root_approx)

# Print complex roots
print("Complex roots:")
for root in complex_roots:
    root_approx = root.evalf()
    print(root_approx)

# Print the number of real roots
num_real_roots = len(real_roots)
print("Number of real roots:", num_real_roots)

# Plot the real part of the function f
p1 = plot(f, (x, -5, 5), title='Graph of f(x)', real=True)

help for Gerschgorin-Circle

Consider a function a follows: f = x^5 - 13x^3 - x^2 + 10x + 170 .Visualize the roots using Gerschgorin-Circle. Include a plot of the function itself, complete with labels and title in your report.in sage math notebook jupyter

I need help for Gerschgorin-Circlewith the Gerschgorin circles root localisation.

Consider the following function:

  • $f = x^5 - 13 x^3 - x^2 + 10 x + 170$

Visualize the roots using Gerschgorin-Circle. Include a plot of the function itself, complete with labels and title, in your report in a SageMath Jupyter notebook.

from sympy import symbols, Poly, solve
from sympy.plotting import plot

# Define the function f and the variable x
x = symbols('x')
f = x**5 - 13*x**3 - x**2 + 10*x + 170

# Convert f to a polynomial
f_poly = Poly(f, x)

# Find all the roots
roots = solve(f_poly, domain='CC')

# Print all roots
print("All roots:")
for root in roots:
    root_approx = root.evalf()
    print(root_approx)

# Filter real and complex roots
real_roots = [root for root in roots if root.is_real]
complex_roots = [root for root in roots if not root.is_real]

# Print real roots
print("Real roots:")
for root in real_roots:
    root_approx = root.evalf()
    print(root_approx)

# Print complex roots
print("Complex roots:")
for root in complex_roots:
    root_approx = root.evalf()
    print(root_approx)

# Print the number of real roots
num_real_roots = len(real_roots)
print("Number of real roots:", num_real_roots)

# Plot the real part of the function f
p1 = plot(f, (x, -5, 5), title='Graph of f(x)', real=True)

Consider a function a follows: f = x^5 - 13x^3 - x^2 + 10x + 170 .Visualize the roots using Gerschgorin-Circle. Include a plot of the function itself, complete with labels and title in your report.in sage math notebook jupyter

I need help with the Gerschgorin circles root localisation.

Consider the following function:

  • $f = x^5 - 13 x^3 - x^2 + 10 x + 170$

Visualize the roots using Gerschgorin-Circle. Include a plot of the function itself, complete with labels and title, in your report in a SageMath Jupyter notebook.

from sympy import symbols, Poly, solve
from sympy.plotting import plot

# Define the function f and the variable x
x = symbols('x')
f = x**5 - 13*x**3 - x**2 + 10*x + 170

# Convert f to a polynomial
f_poly = Poly(f, x)

# Find all the roots
roots = solve(f_poly, domain='CC')

# Print all roots
print("All roots:")
for root in roots:
    root_approx = root.evalf()
    print(root_approx)

# Filter real and complex roots
real_roots = [root for root in roots if root.is_real]
complex_roots = [root for root in roots if not root.is_real]

# Print real roots
print("Real roots:")
for root in real_roots:
    root_approx = root.evalf()
    print(root_approx)

# Print complex roots
print("Complex roots:")
for root in complex_roots:
    root_approx = root.evalf()
    print(root_approx)

# Print the number of real roots
num_real_roots = len(real_roots)
print("Number of real roots:", num_real_roots)

# Plot the real part of the function f
p1 = plot(f, (x, -5, 5), title='Graph of f(x)', real=True)