MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Lists of Equations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg106342] Re: Lists of Equations
  • From: Albert Retey <awnl at gmx-topmail.de>
  • Date: Fri, 8 Jan 2010 06:29:31 -0500 (EST)
  • References: <hi6svt$9uu$1@smc.vnet.net>

Am 08.01.2010 10:13, schrieb Michael Knudsen:
> 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
> thought about defining
> 
> 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.

I think Thread is your friend:

Thread[yeqs==zeqs]

you should also consider to take advantage of the possibility to use
something as y[1] as a variable in NDSolve, which makes the handling of
lists of expressions a lot easier:

lhs = Table[y[i]'[x], {i, 1, 5}]

rhs = Table[z[i][x], {i, 1, 5}]

Thread[lhs == rhs]

hth,

albert


  • Prev by Date: Re: Storing lists on SQL
  • Next by Date: Re: With[..] not working with $Output
  • Previous by thread: Re: Lists of Equations
  • Next by thread: Re: Lists of Equations