Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Well I am asked to do this : (VBA EXCEL) Write a user-defined vba function to determine the real root of f(x) = 5x^3 -

Well I am asked to do this : (VBA EXCEL)

Write a user-defined vba function to determine the real root of f(x) = 5x^3 - 5x^2 + 6x - 2 when xl = 0 xu = 1 and es = 1%.

Below is my code, and I do not know why it is not working or what is wrong with it. It does not work. Please help!!

image text in transcribed

Function f(x) f=5*x^3-5*x^2+6*x-2 End Function Function Bisect(xl, xu, es) Performs Bisection method Dim xrold As Double, test As Double su=1 tsl = f(xl ) ea-100 Relative Error to test xtold =su 'Initial guess of the root loops 0 'Will be used for counting Do While ea eAnd loops 50 XC = (x1 +xy) / 2 loops loops +1 If O Then End If test-f(xl) * f(&W If test 0 Then Else End If lfea= 50 Then Exit Do Loop Bisectx Sheets("Q3" Cells(4, 7) End Function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions