用vb编写程序,用普通迭代法求方程f(x)=x+lgx-2.5=0的近似实根r,迭代初值为1.5,精确到0.0001
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/10/01 02:26:10
用vb编写程序,用普通迭代法求方程f(x)=x+lgx-2.5=0的近似实根r,迭代初值为1.5,精确到0.0001
Private Sub Form_Load()
Me.AutoRedraw = True
Dim x#
x = 1.5
Do Until Abs(f(x)) < 0.0001
x = x - f(x) / df(x)
Loop
Print Format(x, "0.0000")
Print Format(f(x), "0.0000")
End Sub
Private Function f(x#) As Double
f = x + lg(x) - 2.5
End Function
Private Function df(x#) As Double
df = 1 + 1 / (x * Log(10))
End Function
Private Function lg(x#) As Double
lg = Log(x) / Log(10)
End Function
Me.AutoRedraw = True
Dim x#
x = 1.5
Do Until Abs(f(x)) < 0.0001
x = x - f(x) / df(x)
Loop
Print Format(x, "0.0000")
Print Format(f(x), "0.0000")
End Sub
Private Function f(x#) As Double
f = x + lg(x) - 2.5
End Function
Private Function df(x#) As Double
df = 1 + 1 / (x * Log(10))
End Function
Private Function lg(x#) As Double
lg = Log(x) / Log(10)
End Function
用vb编写程序,用普通迭代法求方程f(x)=x+lgx-2.5=0的近似实根r,迭代初值为1.5,精确到0.0001
编写程序,用普通迭代法求方程f(x)=x+lnx-1.56=0的近似实根r(其中ln为自然对数),迭代初值为2,精确到0
1 20 编写程序,用普通迭代法求方程f(x)=x+lgx-3.18=0的近似实根r,迭代初值为2.5,要求结果保留4位
编写程序,用普通迭代法求方程f(x)=x+lnx-1.7=0的近似实根r,迭代初值为1.5,精确到0.0001.〔提示:
用普通迭代法求方程f(x)=x+lnx-1.56=0的近似实根r(其中ln为自然对数),迭代初值为2,精确到0.0001
编写程序,用牛顿切线法求方程f(x)=x^3+2x+10=0的近似实根r,迭代初值为-1,精确到0.0001.
用VB牛顿切线编写程序,用牛顿切线法求方程f(x)=x+lnx-1.7=0的近似实根r迭代初值自选,精确带0.0001.
编写程序,用牛顿切线法求方程f(x)= x+lnx-1.7=0的近似实根r,迭代初值自选,精确到0.0001.〔提示:计
用牛顿切线法求方程f(x)=2x+sinx-4.18=0在区间[0,5]上的近似实根r,迭代初值自选,精确到0.0001
VB编写程序,用牛顿切线法求方程f(x)= x^2-x-8=0(其中^表示 幂运算)在区间[3,4]上的近似实根r,迭代
用java编写一个用迭代法求方程x*x*x-5*x*x+16*x-80=0的实根,误差小于10-6的程序.
求方程lgx-(2^-x)+1=0的近似解,精确到0.1