mehdibgh

240 Reputation

6 Badges

7 years, 276 days

MaplePrimes Activity


These are replies submitted by mehdibgh

@mehdibaghaee any comments yet???

@acer Thanks. Searching those terminologes I am a littile confused. Is it possible to show both methods for very simple functions as below:

y1=sin(x)

y2=cos(x)

thanks in advance

@acerActually I have a worksheet like below:

restart:

y1:=f(x1,x2,x3,...) :

y2:=g(x1,x2,x3,...) :

z:=y1+y2:

it takes two hours to be done, (only one core of my system's CPU is participitated in computation).

I found out that If I set y1 and y2 in different worksheets,and run them simultaneously, then y1+y2 can be computed very quickly, because more cores of CPU are engaged in computation.

What to do to speed up my computation?

@acer I expected Maple shares the computations between the cores automatically; it seems my expectations are very far from the reality.

@mehdibaghaee The examples appeared in help seems a little hard and peculiar for me to understand. It will be very appreciated if someone addresses very simple and tangble example in using parallel computations within Maple.

@tomleslie Could you please introduce a simple example that appropriately subdivided and use the Threads() package to distribute the calculation across multiple cores which should give a significant speed-up?

@Carl Love What about delete such Arrays? I mean how is it possible to claer such special Arrays from Maple's memory?

You mean there is no way?

What is the substitute way to do ?

@acer yes it contains numeric values.

Vector[column](4, [` 50x 500000`*Matrix, `Data Type: `*anything, `Storage: `*rectangular, `Order: `*Fortran_order])

@acer Thanks all for responses

@mehdibaghaee yes, thanks. I got it.

@mehdibaghaee I dont want whole Wn, I want the elements of Wn such as Wn[0,0,1]=3 

@tomleslie I want to receive Wn[0,0,1] as 3

@tomleslie Here is the file you wanted:


 

NULL

restart

with(LinearAlgebra):

II := 4

4

(1)

JJ := 4

4

(2)

N := 6:

a := .3:

b := .1:

TK := add(add(-2*((1/8)*a*b*omega^2*Xi[i, j]^2*(2/(2*i+1)))/(2*j+1), i = 0 .. II), j = 0 .. JJ):

q := max(II+1, JJ+1):

seq(seq(assign(Xi[i, j], `#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[i, j]), i = 0 .. q), j = 0 .. q):

NULL

TKt := -TK*(diff(tau[m](t), t))^2/omega^2:

ct2 := 0:

`Ψm`[1, 1] := Matrix(5, 5, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (1, 4) = 4, (1, 5) = 1, (2, 1) = 1, (2, 2) = 2, (2, 3) = 1, (2, 4) = 1, (2, 5) = 3, (3, 1) = 3, (3, 2) = 3, (3, 3) = 1, (3, 4) = 4, (3, 5) = 1, (4, 1) = 3, (4, 2) = 1, (4, 3) = 1, (4, 4) = 3, (4, 5) = 1, (5, 1) = 2, (5, 2) = 3, (5, 3) = 2, (5, 4) = 1, (5, 5) = 4})

`Ψm`[1, 2] := Matrix(5, 5, {(1, 1) = 3, (1, 2) = 4, (1, 3) = 5, (1, 4) = 6, (1, 5) = 6, (2, 1) = 6, (2, 2) = 3, (2, 3) = 3, (2, 4) = 3, (2, 5) = 3, (3, 1) = 4, (3, 2) = 5, (3, 3) = 5, (3, 4) = 2, (3, 5) = 5, (4, 1) = 1, (4, 2) = 2, (4, 3) = 2, (4, 4) = 5, (4, 5) = 1, (5, 1) = 1, (5, 2) = 1, (5, 3) = 1, (5, 4) = 1, (5, 5) = 6})

M := 2:

for m to M do `#mover(mi("Ξ"),mo("&uminus0;"))` := ArrayTools:-Alias(`Ψm`[1, m], [0 .. II, 0 .. JJ]); TKtm := TKt+ct2; ct2 := TKtm end do:

save TKtm, "TKtm.m":

``

save `#mover(mi("Ξ"),mo("&uminus0;"))`, "sai.m":

TKtm

-(-0.3061224490e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[3, 3]^2-0.2380952380e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[4, 3]^2-0.1666666666e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[0, 4]^2-0.5555555555e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[1, 4]^2-0.3333333334e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[2, 4]^2-0.2380952381e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[3, 4]^2-0.1851851852e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[4, 4]^2-0.1500000000e-1*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[0, 0]^2-0.5000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[1, 0]^2-0.3000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[2, 0]^2-0.2142857143e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[3, 0]^2-0.1666666666e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[4, 0]^2-0.5000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[0, 1]^2-0.1666666666e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[1, 1]^2-0.1000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[2, 1]^2-0.7142857145e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[3, 1]^2-0.5555555555e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[4, 1]^2-0.3000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[0, 2]^2-0.1000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[1, 2]^2-0.6000000000e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[2, 2]^2-0.4285714286e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[3, 2]^2-0.3333333333e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[4, 2]^2-0.2142857143e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[0, 3]^2-0.7142857145e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[1, 3]^2-0.4285714286e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[2, 3]^2)*(diff(tau[2](t), t))^2/omega^2-(-0.3061224490e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[3, 3]^2-0.2380952380e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[4, 3]^2-0.1666666666e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[0, 4]^2-0.5555555555e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[1, 4]^2-0.3333333334e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[2, 4]^2-0.2380952381e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[3, 4]^2-0.1851851852e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[4, 4]^2-0.1500000000e-1*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[0, 0]^2-0.5000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[1, 0]^2-0.3000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[2, 0]^2-0.2142857143e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[3, 0]^2-0.1666666666e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[4, 0]^2-0.5000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[0, 1]^2-0.1666666666e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[1, 1]^2-0.1000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[2, 1]^2-0.7142857145e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[3, 1]^2-0.5555555555e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[4, 1]^2-0.3000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[0, 2]^2-0.1000000000e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[1, 2]^2-0.6000000000e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[2, 2]^2-0.4285714286e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[3, 2]^2-0.3333333333e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[4, 2]^2-0.2142857143e-2*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[0, 3]^2-0.7142857145e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[1, 3]^2-0.4285714286e-3*omega^2*`#mover(mi("Ξ",fontstyle = "normal"),mo("&uminus0;"))`[2, 3]^2)*(diff(tau[1](t), t))^2/omega^2

(3)

-0.3333333333e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[4, 2]^2-0.6000000000e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[2, 2]^2-0.4285714286e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[3, 2]^2-0.1000000000e-2*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[1, 2]^2-0.5555555555e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[4, 1]^2-0.3000000000e-2*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[0, 2]^2-0.7142857145e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[3, 1]^2-0.1666666666e-2*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[1, 1]^2-0.1000000000e-2*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[2, 1]^2-0.2142857143e-2*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[3, 0]^2-0.1666666666e-2*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[4, 0]^2-0.5000000000e-2*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[0, 1]^2-0.5000000000e-2*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[1, 0]^2-0.3000000000e-2*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[2, 0]^2-0.3333333334e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[2, 4]^2-0.2380952381e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[3, 4]^2-0.1851851852e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[4, 4]^2-0.1500000000e-1*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[0, 0]^2-0.2142857143e-2*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[0, 3]^2-0.7142857145e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[1, 3]^2-0.4285714286e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[2, 3]^2-0.3061224490e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[3, 3]^2-0.2380952380e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[4, 3]^2-0.1666666666e-2*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[0, 4]^2-0.5555555555e-3*omega^2*`#mover(mi("Ξ"),mo("&uminus0;"))`[1, 4]^2

-.7646848071*omega^2

(4)

NULL


 

Download TKtmSai.mw

 

Any suggestion to solve the problem?

@tomleslie MatlabI returns 1

2 3 4 5 6 7 8 Page 4 of 9