Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #12268
| From | "Nasser M. Abbasi" <nma@12000.org> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Help with map /@ |
| Date | 2012-11-08 07:07 +0000 |
| Message-ID | <k7flnj$jgu$1@smc.vnet.net> (permalink) |
| References | <k7ct71$dpf$1@smc.vnet.net> |
| Organization | Time-Warner Telecom |
On 11/6/2012 11:56 PM, KFUPM wrote:
> Dear All
>
> I have a this expression:
>
> Ex= T1[x]+T2[y]+T3[z];
>
> I want to integrate the first term with respect to x, the second w.r.t y
>and the third with respect to z and then sum them all.
>I want to use the map function (/@) or similar to do that for me automatically.
>Your help is really appreciated.
>
> HMQ
>
May be
------------------
expr = T1[x]+T2[y]+T3[z];
Total[Table[Integrate[expr[[i]],expr[[i,1]]], {i,Length[expr]}] ]
-----------------------
or if you do not like using Table, another option:
----------------------
expr = T1[x]+T2[y]+T3[z];
funs = Apply[List,expr];
vars = First/@funs;
Total[MapThread[Integrate,{funs,vars}]]
----------------------------
And I am sure, as is typical in Mathematica (since it is a very
flexible language), there are 10 other ways to do this.
--Nasser
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
Help with map /@ KFUPM <hussain.alqahtani@gmail.com> - 2012-11-07 05:56 +0000 Re: Help with map /@ "Nasser M. Abbasi" <nma@12000.org> - 2012-11-08 07:07 +0000
csiph-web