欢迎来到天天文库
浏览记录
ID:59310623
大小:61.00 KB
页数:2页
时间:2020-09-05
《非线性方程的牛顿迭代法求解及VB程序代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、非线性方程的牛顿迭代法求解及VB程序代码例以非线形方程:f(x)=(-RT*Sin(rf)-(L-K)*Cos(θ)*Sin(ω))^2+(Sqr(RT^2-x_T^2)+(L-K)*Sin(θ))^2-((L-K)*Cos(θ)*Cos(ω)*Cos(λ)/Sin(λ)+RT)^2为例,θ为未知数,其它为已知数由方程f(x)可得方程的导数f(x)’f(x)’=dF1dθ=2*(-RT*Sin(rf)-(L-K)*Cos(θ)*Sin(ω))*(L-K)*Sin(θ)*Sin(ω)+2*(Sqr(RT^2-x_T^2)+(L-K
2、)*Sin(θ))*(L-K)*Cos(θ)+2*((L-K)*Cos(θ)*Cos(ω)*Cos(λ)/Sin(λ)+RT)*Sin(θ)*Cos(ω)*Cos(λ)/Sin(λ)δ=0.为收敛精度θ=90*pi/180–λ为给定的初始植(可以根据自己条件给定,不清楚可以设为0开始)δ=0.θ=90*pi/180–λDoF1=(-RT*Sin(rf)-(L-K)*Cos(θ)*Sin(ω))^2+(Sqr(RT^2-x_T^2)+(L-K)*Sin(θ))^2-((L-K)*Cos(θ)*Cos(ω)*Cos(λ)/Sin(λ
3、)+RT)^2dF1dθ=2*(-RT*Sin(rf)-(L-K)*Cos(θ)*Sin(ω))*(L-K)*Sin(θ)*Sin(ω)+2*(Sqr(RT^2-x_T^2)+(L-K)*Sin(θ))*(L-K)*Cos(θ)+2*((L-K)*Cos(θ)*Cos(ω)*Cos(λ)/Sin(λ)+RT)*Sin(θ)*Cos(ω)*Cos(λ)/Sin(λ)F2=dF1dθIfAbs(F1/F2)<δThenθ=θElseθ=θ-F1/F2EndIfLoopUntil精度限制1(F1,F2)=1‘精度限制子程序Public
4、Function精度限制1(F1AsDouble,F2AsDouble)AsIntegerDimtempAsDoubleDim收敛精度AsDouble收敛精度=0.temp=Abs(F1/F2)-收敛精度Iftemp<0Then精度限制1=1Else精度限制1=0EndIfEndFunction
此文档下载收益归作者所有