全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
7245 4
2014-12-09
QQ图片20141209222113.jpg 这样的一个非线性方程组,想用R解出来,其中T是已知的,要求另外三个参数Nb,C,x的值,不知道哪位大神能给个指点,看了几个包,比如BB包,其中的例子不是看的很明白,希望有人能帮助我一下,感激不尽~


二维码

扫码加我 拉你入群

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

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

全部回复
2014-12-10 12:47:53
用Mathmatica,必须要在R中做吗?
二维码

扫码加我 拉你入群

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

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

2015-1-15 22:33:56
Package nleqslv 与 BB 都可以用来解方程
nleqslv(x, fn, jac=NULL,...,
               method = c("Broyden", "Newton"),
               global = c("dbldog", "pwldog", "qline", "gline", "none"),
               xscalm = c("fixed","auto"),
               control = list()
        )



比如这个:
# Dennis Schnabel example 6.5.1 page 149[丹尼斯·施纳贝尔的例子6.5.1第149页]
dslnex <- function(x) {
    y <- numeric(2)
    y[1] <- x[1]^2 + x[2]^2 - 2
    y[2] <- exp(x[1]-1) + x[2]^3 - 2
    y
}

jacdsln <- function(x) {
    n <- length(x)
    Df <- matrix(numeric(n*n),n,n)
    Df[1,1] <- 2*x[1]
    Df[1,2] <- 2*x[2]
    Df[2,1] <- exp(x[1]-1)
    Df[2,2] <- 3*x[2]^2

    Df
}

BADjacdsln <- function(x) {
    n <- length(x)
    Df <- matrix(numeric(n*n),n,n)
    Df[1,1] <- 4*x[1]
    Df[1,2] <- 2*x[2]
    Df[2,1] <- exp(x[1]-1)
    Df[2,2] <- 5*x[2]^2

    Df
}

xstart <- c(2,0.5)
fstart <- dslnex(xstart)
xstart
fstart

# a solution is c(1,1)[一个解决方案是c(1,1)]

nleqslv(xstart, dslnex, control=list(btol=.01))

# Cauchy start[
开始
nleqslv(xstart, dslnex, control=list(trace=1,btol=.01,delta=-1.0))

# Newton start[
开始
nleqslv(xstart, dslnex, control=list(trace=1,btol=.01,delta=-2.0))

## Not run: [#不运行:]
# no global strategy but limit stepsize[没有全局的战略,但限制步长]
# but look carefully: a different solution is found[解决方案
不同
nleqslv(xstart, dslnex, method="Newton", global="none", control=list(trace=1,stepmax=5))

# but if the stepsize is limited even more the c(1,1) solution is found[但是,如果步长限制更被发现的c(1,1),就算找到答案了]
nleqslv(xstart, dslnex, method="Newton", global="none", control=list(trace=1,stepmax=2))

# Broyden also finds the c(1,1) solution when the stepsize is limited[拟牛顿还发现,C(1,1)的解决问题的步长是有限的]
nleqslv(xstart, dslnex, jacdsln, method="Broyden", global="none", control=list(trace=1,stepmax=2))

二维码

扫码加我 拉你入群

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

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

2016-6-10 16:34:14
http://www.ithao123.cn/content-7410942.html牛顿法解非线性方程组,亲测可用
二维码

扫码加我 拉你入群

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

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

2016-8-2 15:05:21
看过了,还好,可是我不太懂其中的雅克比矩阵还要自己写出来吗?
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群