Re: vector differentiation by looping in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg85154] Re: vector differentiation by looping in Mathematica
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 30 Jan 2008 06:10:56 -0500 (EST)
- References: <fne3au$63o$1@smc.vnet.net>
Hi, have a look at the Part[] function, written as a[[i]] and find out what fs={x*y,x*Sin[y]} vars={x,y} and D[fs[[1]],vars[[2]]] mean .. Regards Jens snowrain wrote: > Hi all > I need to take the derivative of a row vector w.r.t. another row vector using Mathematica. > e.g. take the derivative of {a1,a2,....an} w.r.t {b1,b2,....,bk} > But each element in the first row vector is very large and it takes too much ram to run. > I am trying to do it by looping, i.e. take the elements in the first row vector one at a time to take the derivative w.r.t. the second row vector. > Based on what I know, the command "Do" can only take the elements from a true matrix, which cannot only be a vector. Also, I cannot specify the row vector in the way that each row (of a matrix) is only a scalar. i.e. {{a1},{a2},....{an}} because each element is very large, and it takes lots of ram to change just a tiny thing. > Does anyone know how to take the elements in the first row vector one at a time to take the derivative w.r.t. the second row vector? > Thanks a lot! >