0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

mathematica で独立な積分を並列に計算したい: Do parallel Integrate on mathematica

Posted at

並列な処理の命令: Parallel process order

ParallelTableTableと同様の処理を並列に行うとのこと.
例えば,4つの異なる積分を並列に評価させたいなら,以下のように書けば良い:

ParallelTable returns the same process as Table, but with parallel.
If we would like to do parallel integration independently, we should write the following order.

(* 
4成分配列を定義し,各成分に被積分関数を記述 
Define a list having four elements
*)
f = Range[4]
f[[1]] = x;
f[[2]] = Exp[x];
f[[3]] = Cos[x];
f[[4]] = 1;

Result = ParallelTable[
    Integrate[ f[[i]],x ],
{i,1,4}] (*i=1~4 の場合をそれぞれ並列に評価*)

この処理の結果は,以下のようになる:
The above process returns the following result:

{x^2/2,Exp[x],Sin[x],x}

この配列の2番目の結果を取り出したい場合は,
If one wants to take the second element of the result, write:

Result[[2]]

と書く.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?