Generate expression from result
- To: mathgroup at smc.vnet.net
- Subject: [mg32799] Generate expression from result
- From: "Johannes Ludsteck" <johannes.ludsteck at wiwi.uni-regensburg.de>
- Date: Tue, 12 Feb 2002 06:23:55 -0500 (EST)
- Organization: Universitaet Regensburg
- Sender: owner-wri-mathgroup at wolfram.com
Dear Mathgroup Members,
I obtain the vector {x1,x2} as solution to a
(rather complicated) equation system
{x1,x2}=LinearSolve[m[{a1,a2}],b[{a1,a2}]]
Of course, the xi are functions of {a1,a2}.
Since I use the xi later on for complex operations,
it would be of gread help if the arguments ai appeared
in the vector {x1,x2}.
Therefore I defined
f[{a1_,a2_}]=LinearSolve[m[{a1,a2}],b[{a1,a2}]]
(I need "=" here instead of ":=", since f[] is called
often and the LinearSolve[] command uses some time,
since the vectors {x1,x2} and {a1,a2} are only
examples and can have dimension 10 to 20 in my application.
Up to now the solution works well, but I am bothering
whether this construction could generate modularity or
naming problems, since the Assignment
appears in a Module where {a1,a2} are defined as local variables.
fun[...]:=Module[{a1,a2,f},
...
f[{a1_,a2_}]=LinearSolve[m[{a1,a2}],b[{a1,a2}]]
...
]
Can anybody clear things?
Best regards,
Johannes
<><><><><><><><><><><><><><><><><><>
Johannes Ludsteck
Institut fuer Volkswirtschaftslehre
Lehrstuhl Prof. Dr. Moeller
Universitaet Regensburg
Universitaetsstrasse 31
93053 Regensburg
Tel +49/0941/943-2741