From: vexx on 25 Nov 2009 17:46 Lets say that I have defined some simple scalar function for example: DEFINE('P(X,Y,Z)=X^2+Y^2+Z^2') NOVAL Then I stored a simple vector: [X,Y,Z]|>J [X Y Z] If I want do calculate gradient of my scalar function the manual states: DERIV(X^2+Y^2+Z^2,[X,Y,Z]) [2X 2Y 2Z] If I use: DERIVE('P(X,Y,Z),[X,Y,Z]') [2X 2Y 2Z] It's still ok... But if I use : DERIVE('P(X,Y,Z),J') 0 No results.... Suggestion? Second problem is how to save a vector function... My attempt is: DEFINE('O(X,Y,Z)=[2*X,2*Y,2*Z]') "Bad Argument Type" So how to save a vector function? P.S. for people who know mats/physics: I am trying to calculate a gradient of scalar function and get a vector function which I would like too save for later calculation... Tnx!
From: supergems on 26 Nov 2009 03:54 On 25 Nov, 23:46, vexx <vexxm...(a)gmail.com> wrote: > Lets say that I have defined some simple scalar function for example: > DEFINE('P(X,Y,Z)=X^2+Y^2+Z^2') > NOVAL > Then I stored a simple vector: > [X,Y,Z]|>J > [X Y Z] > If I want do calculate gradient of my scalar function the manual states: > DERIV(X^2+Y^2+Z^2,[X,Y,Z]) > [2X 2Y 2Z] > If I use: > DERIVE('P(X,Y,Z),[X,Y,Z]') > [2X 2Y 2Z] > It's still ok... > But if I use : > DERIVE('P(X,Y,Z),J') > 0 > No results.... > Suggestion? > > Second problem is how to save a vector function... My attempt is: > DEFINE('O(X,Y,Z)=[2*X,2*Y,2*Z]') > "Bad Argument Type" > So how to save a vector function? > > P.S. for people who know mats/physics: I am trying to calculate a > gradient of scalar function and get a vector function which I would like > too save for later calculation... > > Tnx! Hi vexx, in RPN mode: \<< [ 'X' 'Y' 'Z' ] DERIV EXPAND \>> 'GRADIENT' STO 'P(X,Y,Z)=X^2+Y^2+Z^2' DEF 'P(X,Y,Z)' GRADIENT --> [ '2*X' '2*Y' '2*Z' ] \<< \-> X Y Z \<< '2*X' EVAL '2*Y' EVAL '2*Z' EVAL \>> \>> 'O' STO ex. 2 3 4 O --> 4 6 8 supergems
|
Pages: 1 Prev: getting back onto the TDS Survey GX card Next: Matrix operations in SysRPL |