Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #12260 > unrolled thread
| Started by | KFUPM <hussain.alqahtani@gmail.com> |
|---|---|
| First post | 2012-11-07 05:56 +0000 |
| Last post | 2012-11-08 07:07 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
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
| From | KFUPM <hussain.alqahtani@gmail.com> |
|---|---|
| Date | 2012-11-07 05:56 +0000 |
| Subject | Help with map /@ |
| Message-ID | <k7ct71$dpf$1@smc.vnet.net> |
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
[toc] | [next] | [standalone]
| From | "Nasser M. Abbasi" <nma@12000.org> |
|---|---|
| Date | 2012-11-08 07:07 +0000 |
| Message-ID | <k7flnj$jgu$1@smc.vnet.net> |
| In reply to | #12260 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web