mehdibgh

235 Reputation

6 Badges

6 years, 17 days

MaplePrimes Activity


These are questions asked by mehdibgh

Hi,

Could anybody help me with how to solve the linear time-varying differential equation set in Maple?

A good example will works well.

How to plot multiple functions with multiple lines (Dot, Dash, Dash-Dot, )  all in one colour?

Like following plot:

I have a function as below,


 

``

restart

II := 11:

Wij := Matrix(12, 12, {(1, 1) = -.745909803077121, (1, 2) = -0.674461080069867e-2, (1, 3) = .834708547865408, (1, 4) = 0.877385723822038e-2, (1, 5) = -0.908081081472752e-1, (1, 6) = -0.239340836231797e-2, (1, 7) = 0.191800718112554e-2, (1, 8) = 0.418141771959862e-3, (1, 9) = 0.146623811902983e-3, (1, 10) = -0.588304624666211e-4, (1, 11) = -0.556596641532947e-4, (1, 12) = 0.483545553955535e-5, (2, 1) = -0.150780560642874e-2, (2, 2) = 0.867791918452209e-3, (2, 3) = 0.153733767594070e-2, (2, 4) = -0.204845456630398e-1, (2, 5) = -0.637707566405370e-4, (2, 6) = 0.212481474445345e-1, (2, 7) = 0.230866935460358e-4, (2, 8) = -0.263384023057254e-2, (2, 9) = 0.173129262456175e-4, (2, 10) = 0.145986418012667e-2, (2, 11) = -0.615768525233225e-5, (2, 12) = -0.455559328816086e-3, (3, 1) = 1.07234104621714, (3, 2) = 0.971025800610391e-2, (3, 3) = -1.19283486996676, (3, 4) = -0.126396150015806e-1, (3, 5) = .118988853710128, (3, 6) = 0.340933797889320e-2, (3, 7) = 0.190278053641238e-2, (3, 8) = -0.565664886428382e-3, (3, 9) = -0.503156502649439e-3, (3, 10) = 0.979522657647879e-4, (3, 11) = 0.113002768409814e-3, (3, 12) = -0.121533604250274e-4, (4, 1) = 0.245302677746526e-2, (4, 2) = 0.611598278493220e-3, (4, 3) = -0.251651574609684e-2, (4, 4) = 0.278857618849383e-1, (4, 5) = 0.108022265014592e-3, (4, 6) = -0.320168363280661e-1, (4, 7) = -0.325097140040140e-4, (4, 8) = 0.480517189034762e-2, (4, 9) = -0.193985210422571e-4, (4, 10) = -0.190626072415250e-2, (4, 11) = 0.739266431705442e-5, (4, 12) = 0.619688407885468e-3, (5, 1) = -.332680012459335, (5, 2) = -0.308899427286697e-2, (5, 3) = .359841697913305, (5, 4) = 0.403401520601850e-2, (5, 5) = -0.200704409346196e-1, (5, 6) = -0.104338164548124e-2, (5, 7) = -0.748747318317741e-2, (5, 8) = 0.123603846422314e-3, (5, 9) = 0.587068975361258e-3, (5, 10) = -0.290076105262677e-4, (5, 11) = -0.191603816451559e-3, (5, 12) = 0.373388286597686e-5, (6, 1) = -0.103361884660837e-2, (6, 2) = -0.295276339713243e-2, (6, 3) = 0.108951918505810e-2, (6, 4) = -0.479183265920926e-2, (6, 5) = -0.592008998858512e-4, (6, 6) = 0.102437161326541e-1, (6, 7) = 0.859907872385912e-5, (6, 8) = -0.266521683446180e-2, (6, 9) = -0.383709478639487e-5, (6, 10) = 0.266632726737390e-3, (6, 11) = -0.148469080898987e-5, (6, 12) = -0.101665157432172e-3, (7, 1) = 0.703379342372258e-2, (7, 2) = 0.176251183163216e-3, (7, 3) = -0.145630485079540e-2, (7, 4) = -0.233067786529769e-3, (7, 5) = -0.922702754264408e-2, (7, 6) = 0.364384299428906e-4, (7, 7) = 0.417281143846606e-2, (7, 8) = 0.324111696921334e-4, (7, 9) = -0.484660014401307e-3, (7, 10) = -0.128619131156994e-4, (7, 11) = -0.412616528382663e-4, (7, 12) = 0.7982985444e-6, (8, 1) = 0.974187082179976e-4, (8, 2) = 0.155548383221531e-2, (8, 3) = -0.123838922170996e-3, (8, 4) = -0.249773787243565e-2, (8, 5) = 0.221867864063737e-4, (8, 6) = 0.480516696280202e-3, (8, 7) = -0.359606407557896e-5, (8, 8) = 0.433976774887701e-3, (8, 9) = 0.811301081325245e-5, (8, 10) = 0.727673884033783e-4, (8, 11) = -0.3022512840e-6, (8, 12) = -0.468064718553966e-4, (9, 1) = -0.682570264341669e-3, (9, 2) = -0.587007804372093e-4, (9, 3) = -0.666643577308233e-3, (9, 4) = 0.662778988863377e-4, (9, 5) = 0.125271290023062e-2, (9, 6) = -0.232225466973706e-5, (9, 7) = -0.410694230883052e-3, (9, 8) = -0.106713819648935e-4, (9, 9) = 0.366616746138017e-3, (9, 10) = 0.217010277855600e-5, (9, 11) = 0.135713097667273e-3, (9, 12) = 0.320410261333838e-5, (10, 1) = -0.101818162719231e-4, (10, 2) = -0.157599695320146e-3, (10, 3) = 0.929732652373664e-5, (10, 4) = -0.189234110745728e-3, (10, 5) = -0.859354584213451e-5, (10, 6) = 0.214578509593470e-4, (10, 7) = 0.613328774334630e-5, (10, 8) = 0.117712820070324e-3, (10, 9) = -0.213534503887478e-5, (10, 10) = 0.179089799811260e-3, (10, 11) = 0.546912773241878e-5, (10, 12) = 0.273197376236470e-4, (11, 1) = -0.108150650095191e-3, (11, 2) = 0.568807678432329e-5, (11, 3) = 0.416808900313591e-3, (11, 4) = -0.132889420052041e-5, (11, 5) = -0.136041936047118e-3, (11, 6) = -0.673784027004257e-5, (11, 7) = -0.942090825967484e-4, (11, 8) = 0.222185688977502e-5, (11, 9) = -0.113443667198581e-3, (11, 10) = 0.6962003263e-6, (11, 11) = 0.361765818744130e-4, (11, 12) = -0.5344899574e-6, (12, 1) = 0.112445517997156e-5, (12, 2) = 0.741957037817598e-4, (12, 3) = 0.420901487126838e-5, (12, 4) = 0.763065573748303e-4, (12, 5) = 0.136237864072227e-5, (12, 6) = 0.239279022456648e-4, (12, 7) = -0.171222080223248e-5, (12, 8) = -0.577109791933568e-4, (12, 9) = -0.3869218336e-7, (12, 10) = -0.715889637469861e-4, (12, 11) = -0.491358853466192e-5, (12, 12) = -0.419960052327950e-4})

Wij := Matrix(12, 12, {(1, 1) = -.745909803077121, (1, 2) = -0.674461080069867e-2, (1, 3) = .834708547865408, (1, 4) = 0.877385723822038e-2, (1, 5) = -0.908081081472752e-1, (1, 6) = -0.239340836231797e-2, (1, 7) = 0.191800718112554e-2, (1, 8) = 0.418141771959862e-3, (1, 9) = 0.146623811902983e-3, (1, 10) = -0.588304624666211e-4, (1, 11) = -0.556596641532947e-4, (1, 12) = 0.483545553955535e-5, (2, 1) = -0.150780560642874e-2, (2, 2) = 0.867791918452209e-3, (2, 3) = 0.153733767594070e-2, (2, 4) = -0.204845456630398e-1, (2, 5) = -0.637707566405370e-4, (2, 6) = 0.212481474445345e-1, (2, 7) = 0.230866935460358e-4, (2, 8) = -0.263384023057254e-2, (2, 9) = 0.173129262456175e-4, (2, 10) = 0.145986418012667e-2, (2, 11) = -0.615768525233225e-5, (2, 12) = -0.455559328816086e-3, (3, 1) = 1.07234104621714, (3, 2) = 0.971025800610391e-2, (3, 3) = -1.19283486996676, (3, 4) = -0.126396150015806e-1, (3, 5) = .118988853710128, (3, 6) = 0.340933797889320e-2, (3, 7) = 0.190278053641238e-2, (3, 8) = -0.565664886428382e-3, (3, 9) = -0.503156502649439e-3, (3, 10) = 0.979522657647879e-4, (3, 11) = 0.113002768409814e-3, (3, 12) = -0.121533604250274e-4, (4, 1) = 0.245302677746526e-2, (4, 2) = 0.611598278493220e-3, (4, 3) = -0.251651574609684e-2, (4, 4) = 0.278857618849383e-1, (4, 5) = 0.108022265014592e-3, (4, 6) = -0.320168363280661e-1, (4, 7) = -0.325097140040140e-4, (4, 8) = 0.480517189034762e-2, (4, 9) = -0.193985210422571e-4, (4, 10) = -0.190626072415250e-2, (4, 11) = 0.739266431705442e-5, (4, 12) = 0.619688407885468e-3, (5, 1) = -.332680012459335, (5, 2) = -0.308899427286697e-2, (5, 3) = .359841697913305, (5, 4) = 0.403401520601850e-2, (5, 5) = -0.200704409346196e-1, (5, 6) = -0.104338164548124e-2, (5, 7) = -0.748747318317741e-2, (5, 8) = 0.123603846422314e-3, (5, 9) = 0.587068975361258e-3, (5, 10) = -0.290076105262677e-4, (5, 11) = -0.191603816451559e-3, (5, 12) = 0.373388286597686e-5, (6, 1) = -0.103361884660837e-2, (6, 2) = -0.295276339713243e-2, (6, 3) = 0.108951918505810e-2, (6, 4) = -0.479183265920926e-2, (6, 5) = -0.592008998858512e-4, (6, 6) = 0.102437161326541e-1, (6, 7) = 0.859907872385912e-5, (6, 8) = -0.266521683446180e-2, (6, 9) = -0.383709478639487e-5, (6, 10) = 0.266632726737390e-3, (6, 11) = -0.148469080898987e-5, (6, 12) = -0.101665157432172e-3, (7, 1) = 0.703379342372258e-2, (7, 2) = 0.176251183163216e-3, (7, 3) = -0.145630485079540e-2, (7, 4) = -0.233067786529769e-3, (7, 5) = -0.922702754264408e-2, (7, 6) = 0.364384299428906e-4, (7, 7) = 0.417281143846606e-2, (7, 8) = 0.324111696921334e-4, (7, 9) = -0.484660014401307e-3, (7, 10) = -0.128619131156994e-4, (7, 11) = -0.412616528382663e-4, (7, 12) = 0.798298544439708e-6, (8, 1) = 0.974187082179976e-4, (8, 2) = 0.155548383221531e-2, (8, 3) = -0.123838922170996e-3, (8, 4) = -0.249773787243565e-2, (8, 5) = 0.221867864063737e-4, (8, 6) = 0.480516696280202e-3, (8, 7) = -0.359606407557896e-5, (8, 8) = 0.433976774887701e-3, (8, 9) = 0.811301081325245e-5, (8, 10) = 0.727673884033783e-4, (8, 11) = -0.302251283982269e-6, (8, 12) = -0.468064718553966e-4, (9, 1) = -0.682570264341669e-3, (9, 2) = -0.587007804372093e-4, (9, 3) = -0.666643577308233e-3, (9, 4) = 0.662778988863377e-4, (9, 5) = 0.125271290023062e-2, (9, 6) = -0.232225466973706e-5, (9, 7) = -0.410694230883052e-3, (9, 8) = -0.106713819648935e-4, (9, 9) = 0.366616746138017e-3, (9, 10) = 0.217010277855600e-5, (9, 11) = 0.135713097667273e-3, (9, 12) = 0.320410261333838e-5, (10, 1) = -0.101818162719231e-4, (10, 2) = -0.157599695320146e-3, (10, 3) = 0.929732652373664e-5, (10, 4) = -0.189234110745728e-3, (10, 5) = -0.859354584213451e-5, (10, 6) = 0.214578509593470e-4, (10, 7) = 0.613328774334630e-5, (10, 8) = 0.117712820070324e-3, (10, 9) = -0.213534503887478e-5, (10, 10) = 0.179089799811260e-3, (10, 11) = 0.546912773241878e-5, (10, 12) = 0.273197376236470e-4, (11, 1) = -0.108150650095191e-3, (11, 2) = 0.568807678432329e-5, (11, 3) = 0.416808900313591e-3, (11, 4) = -0.132889420052041e-5, (11, 5) = -0.136041936047118e-3, (11, 6) = -0.673784027004257e-5, (11, 7) = -0.942090825967484e-4, (11, 8) = 0.222185688977502e-5, (11, 9) = -0.113443667198581e-3, (11, 10) = 0.696200326268231e-6, (11, 11) = 0.361765818744130e-4, (11, 12) = -0.534489957398908e-6, (12, 1) = 0.112445517997156e-5, (12, 2) = 0.741957037817598e-4, (12, 3) = 0.420901487126838e-5, (12, 4) = 0.763065573748303e-4, (12, 5) = 0.136237864072227e-5, (12, 6) = 0.239279022456648e-4, (12, 7) = -0.171222080223248e-5, (12, 8) = -0.577109791933568e-4, (12, 9) = -0.386921833637950e-7, (12, 10) = -0.715889637469861e-4, (12, 11) = -0.491358853466192e-5, (12, 12) = -0.419960052327950e-4})

(1)

Wxy1 := add(add(h*Wij[i+1, j+1]*LegendreP(i, Zeta)*LegendreP(j, eta), i = 0 .. II), j = 0 .. JJ):

Wxy[1] := simplify(Wxy1):

Plt := plot3d(Wxy[1], Zeta = -1 .. 1, eta = -1 .. 1)

 

``

``

``


 

Download Quesions.mw

How I can normalize it in range [0,1]

During running my ws I faced with memory error as below, where as my system have enough memory (120GB)

Warning, Run: unable to set assignto result due to error:  Maple was unable to allocate enough memory to complete this computation.  Please see ?alloc

Maple's help suggests :Software limits are imposed by the -T command-line argument, the datalimit argument to kernelopts and system imposed user limits (for example shell limits).
  But I could not understand how to increase software limit.

 

how to fix that?

I unprotect the GAMMA, but still receives error:

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.


 

NULL

restart

II := 2

2

(1)

JJ := 2

2

(2)

N := 2:

unprotect(GAMMA):

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

M := 5:

seq(seq(seq(assign(GAMMA[i, j, r], a*`#mover(mi("Γ",fontstyle = "normal"),mo("&uminus0;"))`[i, j, r]), i = 0 .. q), j = 0 .. q), r = 1 .. N):

a := .2:

RrProc := proc (i, m) local K, j, Q; if i <= m then 0 else K := 1; Q := Matrix(i, 1); for j by 2 to i do Q(j) := 2*i-K; K := 4+K end do; Q := FlipDimension(Q, 1); Q(m+1) end if end proc:
``

`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))` := Array(0 .. II, 0 .. JJ, 1 .. 6, 1 .. M):

f1 := RandomArray(II+1, JJ+1):

for m to M do `&Gamma;m`[1, m] := f1; `&Gamma;m`[2, m] := f2; `&Gamma;m`[3, m] := f3; `&Gamma;m`[4, m] := f4; `&Gamma;m`[5, m] := f5; `&Gamma;m`[6, m] := f6 end do:

unprotect(`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`):

for m to M do `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 1, m] := ArrayTools:-Alias(`&Gamma;m`[1, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 2, m] := ArrayTools:-Alias(`&Gamma;m`[2, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 3, m] := ArrayTools:-Alias(`&Gamma;m`[3, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 4, m] := ArrayTools:-Alias(`&Gamma;m`[4, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 5, m] := ArrayTools:-Alias(`&Gamma;m`[5, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 6, m] := ArrayTools:-Alias(`&Gamma;m`[6, m], [0 .. II, 0 .. JJ]) end do:

UP := proc (s, GAMMA, N, M, a, b, II, JJ) local k; i, j, r, p, m, q, n, l; if s = 1 then add(add(add(add(add(add((2/3)*Rr[i, m]*Rr[k, m]*b*add(GAMMA[i, j, q, p]*GAMMA[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) elif s = 2 then add(add(add(add(add(add((1/2)*Rr[i, m]*Rr[k, m]*b*add(GAMMA[i, j, q, p]*GAMMA[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) end if end proc:

Grid:-Seq(UP(s, GAMMA, N, M, a, b, II, JJ), s = 1 .. 2)

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

UP(1, GAMMA, N, M, a, b, II, JJ), UP(2, GAMMA, N, M, a, b, II, JJ)

(3)

NULL


 

Download soal.mw

 

What is the problem?

 

3 4 5 6 7 8 9 Last Page 5 of 17