Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15431 > unrolled thread
| Started by | Parada Hutauruk <phutauruk@gmail.com> |
|---|---|
| First post | 2013-09-14 09:48 +0000 |
| Last post | 2013-09-15 11:00 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
multiintegral and table Parada Hutauruk <phutauruk@gmail.com> - 2013-09-14 09:48 +0000
Re: multiintegral and table "Dr. Wolfgang Hintze" <weh@snafu.de> - 2013-09-15 11:00 +0000
| From | Parada Hutauruk <phutauruk@gmail.com> |
|---|---|
| Date | 2013-09-14 09:48 +0000 |
| Subject | multiintegral and table |
| Message-ID | <l11bdn$isn$1@smc.vnet.net> |
Dear all,
I have a function
f_1 [x_,y_] = Integrate[2*y + x^2, {x,0,1},{y,0,x}]
f_2 [x_,y_,Q_] = Integrate[2*y +x^2*Q, {x,0,1},{y,0,x}]
f_total [x_,y_,Q_] = f_1[x,y] + f_2[x,y,Q]
Then I want to plot the f total using table with Q start from 0 to 10 with increment 0.0025.
I have defined by
dataxx = Table[{Q,f_total[x,y,Q]}, {Q, 0,10, 0.0025}]
And Plot the data on the table by
ListPlot[dataxx]
But when I evaluate the function, it took a long time and the plot is not yielded. Could anyone help me please to find the bug? I really appreciate for help.
Thanks,
PTPH
[toc] | [next] | [standalone]
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
|---|---|
| Date | 2013-09-15 11:00 +0000 |
| Message-ID | <l143vt$pre$1@smc.vnet.net> |
| In reply to | #15431 |
Am Samstag, 14. September 2013 11:48:39 UTC+2 schrieb Parada Hutauruk:
> Dear all,
>
>
>
> I have a function
>
>
>
> f_1 [x_,y_] = Integrate[2*y + x^2, {x,0,1},{y,0,x}]
>
>
>
> f_2 [x_,y_,Q_] = Integrate[2*y +x^2*Q, {x,0,1},{y,0,x}]
>
>
>
> f_total [x_,y_,Q_] = f_1[x,y] + f_2[x,y,Q]
>
>
>
> Then I want to plot the f total using table with Q start from 0 to 10 with increment 0.0025.
>
>
>
> I have defined by
>
>
>
> dataxx = Table[{Q,f_total[x,y,Q]}, {Q, 0,10, 0.0025}]
>
>
>
> And Plot the data on the table by
>
>
>
> ListPlot[dataxx]
>
>
>
> But when I evaluate the function, it took a long time and the plot is not yielded. Could anyone help me please to find the bug? I really appreciate for help.
>
>
>
> Thanks,
>
> PTPH
It's a simple syntax problem: "underline" is a reseerved Symbol im Mathematica (by the way, a very important one!); you must not use "underline" in a variable name.
Hence your code corrected in this respect works fine:
In[1]:= f1[x_, y_] = Integrate[2*y + x^2, {x, 0, 1}, {y, 0, x}]
f2[x_, y_, Q_] = Integrate[2*y + x^2*Q, {x, 0, 1}, {y, 0, x}]
ftotal[x_, y_, Q_] = f1[x, y] + f2[x, y, Q]
Out[1]= 7/12
Out[2]= 1/3 + Q/4
Out[3]= 11/12 + Q/4
(* in the following line I have reduce the number of terms putting the step = 1*)
In[9]:= dataxx = Table[{Q, ftotal[x, y, Q]}, {Q, 0, 10}]
Out[9]= {{0, 11/12}, {1, 7/6}, {2, 17/12}, {3, 5/3}, {4, 23/12}, {5,
13/6}, {6, 29/12}, {7, 8/3}, {8, 35/12}, {9, 19/6}, {10, 41/12}}
Regards,
Wolfgang
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web