Hello,
I keep getting an error message, any hints would be appreciated
[Option Explicit
Function Bisection(xl, xu, es)
Dim xold As Double, xr As Double
If func(xl) * func(xu) >= 0 Then
MsgBox "No sign change!"
Exit Function
End If
Do
xold = xr
xr = (xl + xu) / 2
If func(xr) = 0 Then Exit Do
If func(xr) * func(xl) < 0 Then
xu = xr
Else
xl = xr
End If
If xr <> 0 Then
If Abs((xr - xold) / xr) * 100 < es Then
Exit Do
End If
Else
xold = xr
End If
Loop
Bisection = xr
End Function
Function func(x)
func = x ^ 3 + 4 * x ^ 2 - 10
End Function]
bisection method for functions roots
Page 1 of 11 Replies - 283 Views - Last Post: 07 February 2012 - 01:12 AM
Topic Sponsor:
Replies To: bisection method for functions roots
#2
Re: bisection method for functions roots
Posted 07 February 2012 - 01:12 AM
A hint at the error message would be useful, or do you expect us to run the code and debug it for you?
Also, please edit your post and put your code in the [ CODE] tags, it will make so much easier for people to read.
Also, please edit your post and put your code in the [ CODE] tags, it will make so much easier for people to read.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|