楼主: zhangtao
3082 8

各位朋友,在gauss中如何求偏导数? [推广有奖]

  • 3关注
  • 42粉丝

已卖:431份资源

学科带头人

41%

还不是VIP/贵宾

-

威望
0
论坛币
2302 个
通用积分
908.3324
学术水平
114 点
热心指数
120 点
信用等级
83 点
经验
52009 点
帖子
1552
精华
1
在线时间
2357 小时
注册时间
2005-1-13
最后登录
2024-5-21

楼主
zhangtao 发表于 2011-2-19 11:58:25 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
各位朋友,在gauss中如何求偏导数?谢谢!
二维码

扫码加我 拉你入群

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

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

关键词:GAUSS USS Aus 偏导数 朋友 GAUSS 导数

沙发
iooo 发表于 2011-2-20 10:10:13
zhangtao 发表于 2011-2-19 11:58
各位朋友,在gauss中如何求偏导数?谢谢!
gradp 不行么?

藤椅
zhangtao 发表于 2011-2-20 15:40:58
Gradp 的官方解释是:Computes first derivative of a function.
所以用这个命令只能求一阶导数,那如何求一阶和二阶偏导数?

板凳
zhangtao 发表于 2011-2-20 15:43:04
gradp

Purpose

Computes the gradient vector or matrix (Jacobian) of a vector-valued function that has been defined in a procedure. Single-sided (forward difference) gradients are computed.

Format

g = gradp(&f,x0);

Input


&f
a pointer to a vector-valued function (f:Kx1 - > Nx1) defined as a procedure. It is acceptable for f(x) to have been defined in terms of global arguments in addition to x, and thus f can return an Nx1 vector:


  
proc f(x);


  
  
retp( exp(x.*b) );


  
endp;

x0
Kx1 vector of points at which to compute gradient.


Output


g
NxK matrix containing the gradients of f with respect to the variable x at x0.


Remarks

gradp will return a row for every row that is returned by f. For instance, if f returns a scalar result, then gradp will return a 1xK row vector. This allows the same function to be used regardless of N, where N is the number of rows in the result returned by f. Thus, for instance, gradp can be used to compute the Jacobian matrix of a set of equations.

Example

proc myfunc(x);

retp( x.*2 .* exp( x.*x./3 ) );

endp;



x0 = 2.5|3.0|3.5;

y = gradp(&myfunc,x0);

  


It is a 3x3 matrix because we are passing it 3 arguments and myfunc returns 3 results when we do that; the off-diagonals are zeros because the cross-derivatives of 3 arguments are 0.

报纸
zhangtao 发表于 2011-2-20 16:36:30
proc myfunc(x);

retp(x.*2.*exp(x.*x./3));

endp;



x0= 2.5|3.0|3.5;

y=gradp(&myfunc,x0);

运行以上例子,怎么会提示以下错误?谢谢!
(0) : error G0008 : '; retp(x.*2.*exp(x.*x./3))' : Syntax error

地板
zhong1969 发表于 2011-2-22 20:59:12
>> y;

       82.989017       0.00000000       0.00000000
      0.00000000        281.19753       0.00000000
      0.00000000       0.00000000        1087.9541

这是我的运行结果,没出现错误呀……

7
zhangtao 发表于 2011-2-22 22:09:29
proc myfunc(x);

retp(x.*2.*exp(x.*x./3));

endp;

x0= 2.5|3.0|3.5;

y=gradp(&myfunc,x0);

print y;
还是提示以下错误:


(0) : error G0008 : '; retp(x.*2.*exp(x.*x./3))' : Syntax error

8
zhangtao 发表于 2011-2-24 20:56:52
问题还是没有解决,如何在Gauss中求偏导数呢?

9
zhangtao 发表于 2011-3-15 19:33:35
近来明白了2楼朋友的说法是正确的,感谢!

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-20 11:15