这个方程是“解不出来”的……用VBA试试!- Sub abc()a1 = 4: m0 = 1: k = 1: b = -3 '一个例子
- Dim z0 As Double, z1 As Double
- z0 = 0 '赋初值
- z1 = z0
- Do
- z0 = z1
- fz = a1 * Exp(m * z0) * Sin(z0) - a1 * Exp(m * z0) * Cos(z0) - b
- flz = a1 * Exp(m * z0) * Cos(z0) + a1 * m * Exp(m * z0) * Cos(z0) _
- - a1 * m * Exp(m * z0) * Cos(z0) + a1 * Exp(m * z0) * Sin(z0)z1 = z0 - fz / flz
- Loop While Abs(z1 - z0) > 0.000000001x = a1 * Exp(z0) * Cos(z0)
- y = a1 * Exp(z0) * Sin(z0)
- MsgBox "z0=" & z0 & "时" & vbCrLf & vbCrLf & "x=" & x & vbCrLf & "y=" & yEnd Sub
另,这个交点可是有无穷多个啊!这个例子只是求出一个。(代码中的z0就是β)
|