From: Ignacio Plazeta on 23 Jan 2010 07:29 Dear Friends -- 1 ----------------------------------------------- This command works fine: Series[ Exp[ x + 2 y^x ] , {x, 0, 2} , {y, 0, 2} ] this one doesn't: Series[ Exp[ x + 2 y^x ] , {{x, 0, 2}, {y, 0, 2}} ] It returns: "Series specification is not a list with three elements ..." -- 2 ----------------------------------------------- I'm trying to set up this kind of function: myTaylorExpander[ function_ , varList , startPoint_ , ord_ ] where varList length is changing; because of the above mentioned behavior of Series function I can't simply try something like: numVar = Length[ varList ]; args = Table[ { varList[[k]] , startPoint , ord} , { k, 1 , numVar } ] Series[ f , args ] // Normal -- 3 ----------------------------------------------- Is there a way to get out of this by a trick to pass a functions a changing number of variable ? Anything else fitting is welcomed too. Warmest Regards. Ignacio Plazeta ( Spain )
From: Bill Rowe on 24 Jan 2010 05:37 On 1/23/10 at 7:29 AM, Ignacio.Plazeta(a)speednet.es (Ignacio Plazeta) wrote: >-- 1 ----------------------------------------------- >This command works fine: >Series[ Exp[ x + 2 y^x ] , {x, 0, 2} , {y, 0, 2} ] >this one doesn't: >Series[ Exp[ x + 2 y^x ] , {{x, 0, 2}, {y, 0, 2}} ] To convert the list to a sequence of arguments use Sequence. That is Series[Exp[x + 2 y^x], Sequence @@ {{x, 0, 2}, {y, 0, 2}}] will do what you want
From: Albert Retey on 24 Jan 2010 05:40 Am 23.01.2010 13:29, schrieb Ignacio Plazeta: > Dear Friends > > -- 1 ----------------------------------------------- > > This command works fine: > > Series[ Exp[ x + 2 y^x ] , {x, 0, 2} , {y, 0, 2} ] > > this one doesn't: > > Series[ Exp[ x + 2 y^x ] , {{x, 0, 2}, {y, 0, 2}} ] > > It returns: > > "Series specification is not a list with three elements ..." > > -- 2 ----------------------------------------------- > > I'm trying to set up this kind of function: > > myTaylorExpander[ function_ , varList , startPoint_ , ord_ ] > > where varList length is changing; because of the above mentioned > behavior of Series function I can't simply try something like: > > numVar = Length[ varList ]; > > args = Table[ > > { varList[[k]] , startPoint , ord} > > , { k, 1 , numVar } > > ] > > Series[ f , args ] // Normal > > -- 3 ----------------------------------------------- > > Is there a way to get out of this by a trick to pass a functions > a changing number of variable ? Anything else fitting is welcomed too. What you are looking for is Sequence, see the code below: varList = {x, y, z}; numVar = Length[varList] startPoint = 0; ord = 2; args = Apply[Sequence,Table[{varList[[k]], startPoint, ord}, {k, 1, numVar}]] Series[f[x, y, z], args] // Normal note that you will get more replies when you provide a working example with which people can play around... hth, albert
From: David Park on 24 Jan 2010 05:45 You need to use two lists, not a single array. That is, get rid of the extra {}. Series[Exp[x + 2 y^x], {x, 0, 2}, {y, 0, 2}] David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: Ignacio Plazeta [mailto:Ignacio.Plazeta(a)speednet.es] Dear Friends -- 1 ----------------------------------------------- This command works fine: Series[ Exp[ x + 2 y^x ] , {x, 0, 2} , {y, 0, 2} ] this one doesn't: Series[ Exp[ x + 2 y^x ] , {{x, 0, 2}, {y, 0, 2}} ] It returns: "Series specification is not a list with three elements ..." -- 2 ----------------------------------------------- I'm trying to set up this kind of function: myTaylorExpander[ function_ , varList , startPoint_ , ord_ ] where varList length is changing; because of the above mentioned behavior of Series function I can't simply try something like: numVar = Length[ varList ]; args = Table[ { varList[[k]] , startPoint , ord} , { k, 1 , numVar } ] Series[ f , args ] // Normal -- 3 ----------------------------------------------- Is there a way to get out of this by a trick to pass a functions a changing number of variable ? Anything else fitting is welcomed too. Warmest Regards. Ignacio Plazeta ( Spain )
|
Pages: 1 Prev: BezierCurve vs. BezierFunction Next: Crash when using Dot on matrices, v 6.0.2 |