       Re: Lists of Equations

• To: mathgroup at smc.vnet.net
• Subject: [mg106358] Re: [mg106307] Lists of Equations
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Sun, 10 Jan 2010 03:30:18 -0500 (EST)
• Reply-to: hanlonr at cox.net

```It is generally more convenient to use the form z[x] rather than z1[x]

n = 3;

yVar = Array[y, n];

zVar = Array[z, n];

zx = Through[zVar[x]]

{z[x], z[x], z[x]}

which is equivalent to

zx = (#[x] & /@ zVar)

{z[x], z[x], z[x]}

dy = D[Through[yVar[x]], x]

{Derivative[y][x], Derivative[y][x], Derivative[y][x]}

which is equivalent to

dy = (#'[x] & /@ yVar)

{Derivative[y][x], Derivative[y][x], Derivative[y][x]}

eqs = Thread[dy == zx]

{Derivative[y][x] == z[x], Derivative[y][x] == z[x],
Derivative[y][x] == z[x]}

Bob Hanlon

---- Michael Knudsen <micknudsen at gmail.com> wrote:

=============
Hello,

I have just started using Mathematica, and I wonder what the easiest
way to manage a large set of equations is. I have a bunch of
differential equations

y1'[x] = z1[x]
y2'[x] = z2[x]
...
yn'[x] = zn[x]

and I have grouped them together in a list like

eqs = {y1'[x]==z1[x], ..., yn'[x]==zn[x]}

which fits perfectly as an argument to NDSolve. However, I think that,
at a later point, I may have to use z1,...,zn separately, and I

yeqs = {y1'[x],...,yn'[x]}
zeqs = {z1[x],...,zn[x]}

and them combine them. What I would really like is something like

yeqs + "==" + zeqs

but I can't seem to find any list operation that will do that. Any
help is appreciated.

Thanks,
Michael Knudsen

--

Bob Hanlon

```

• Prev by Date: Re: Symbolic Formula
• Next by Date: Re: More /.{I->-1} craziness
• Previous by thread: Re: Lists of Equations
• Next by thread: The location of documentation center file