楼主: 山与玉来
4053 2

sas可否解方程组,求教高手 [推广有奖]

  • 0关注
  • 0粉丝

已卖:400份资源

本科生

40%

还不是VIP/贵宾

-

威望
0
论坛币
1618 个
通用积分
0.0027
学术水平
1 点
热心指数
0 点
信用等级
0 点
经验
906 点
帖子
102
精华
0
在线时间
0 小时
注册时间
2007-5-19
最后登录
2010-10-13

楼主
山与玉来 发表于 2008-9-18 22:53:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

求教高手

sas可否解方程组,非线性的,如何操作?

望高手不吝赐教,多谢!

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:解方程组 方程组 解方程 如何操作 非线性 高手 SAS 求教 解方程

喜欢狮子座王菲,特立独行。精彩点击:

沙发
zyuanqian 发表于 2008-9-19 01:15:00
Newton's Method for Solving Nonlinear Systems of Equations

This example solves a nonlinear system of equations by Newton's method. Let the nonlinear system be represented by

F(x) = 0
where x is a vector and F is a vector-valued, possibly nonlinear, function.

In order to find x such that F goes to 0, an initial estimate x0 is chosen, and Newton's iterative method for converging to the solution is used:

xn+1 = xn - J-1(xn) F(xn)
where J(x) is the Jacobian matrix of partial derivatives of F with respect to x.

For optimization problems, the same method is used, where F(x) is the gradient of the objective function and J(x) becomes the Hessian (Newton-Raphson).

In this example, the system to be solved is

x_1 + x_2 - x_1{x}_2 + 2 & = & 0 \ x_1 \exp(-x_2) - 1 & = & 0
The code is organized into three modules: NEWTON, FUN, and DERIV.
 /* Newton's Method to Solve a Nonlinear Function */ /* The user must supply initial values, */ /* and the FUN and DERIV functions. */ /* on entry: FUN evaluates the function f in terms of x */ /* initial values are given to x */ /* DERIV evaluates jacobian j */ /* tuning variables: CONVERGE, MAXITER. */ /* on exit: solution in x, function value in f close to 0 */ /* ITER has number of iterations. */ start newton; run fun; /* evaluate function at starting values */ do iter=1 to maxiter /* iterate until maxiter iterations */ while(max(abs(f))>converge); /* or convergence */ run deriv; /* evaluate derivatives in j */ delta=-solve(j,f); /* solve for correction vector */ x=x+delta; /* the new approximation */ run fun; /* evaluate the function */ end; finish newton; maxiter=15; /* default maximum iterations */ converge=.000001; /* default convergence criterion */ /* User-supplied function evaluation */ start fun; x1=x[1] ; x2=x[2] ; /* extract the values */ f= (x1+x2-x1*x2+2)// (x1*exp(-x2)-1); /* evaluate the function */ finish fun; /* User-supplied derivatives of the function */ start deriv; /* evaluate jacobian */ j=((1-x2)||(1-x1) )//(exp(-x2)||(-x1*exp(-x2))); finish deriv; do; print "Solving the system: X1+X2-X1*X2+2=0, X1*EXP(-X2)-1=0" ,; x={.1, -2}; /* starting values */ run newton; print x f; end; Newton-Raphson是其中的一种方法

藤椅
山与玉来 发表于 2008-9-19 22:02:00

多谢,可否帮我解一个实例好让我明白?

喜欢狮子座王菲,特立独行。精彩点击:

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-9 11:21