fnavarro

20 Reputation

One Badge

2 years, 239 days

MaplePrimes Activity


These are questions asked by fnavarro

Dear All,

I have an executable program which I have generated with Fortran. Is it possible to run such a program from Maple? It sounds a bit weird but that would simplify my computation, since I would not need to use scripts in Linux. Thank you very much.

Cheers.

I am trying to define a sum which is obtained from linked functions (which also contain the sum command). 

The problem is: if I modify the first function p and rerun the worksheet (except fot the restart command), then the changes do not affect the result. Does anyone know why? Thank you very much.
 

I start with this

restart

p := proc (i, j) options operator, arrow; sum('cat(A, _, i, j, k)', 'k' = 1 .. 3) end proc

proc (i, j) options operator, arrow; sum('cat(A, _, i, j, k)', 'k' = 1 .. 3) end proc

(1)

q := proc (i) options operator, arrow; sum('p(i, j)', 'j' = 1 .. 3) end proc

proc (i) options operator, arrow; sum('p(i, j)', 'j' = 1 .. 3) end proc

(2)

r := sum('q(i)', 'i' = 1 .. 3)

A_331+A_332+A_333+A_321+A_322+A_323+A_311+A_312+A_313+A_231+A_232+A_233+A_221+A_222+A_223+A_211+A_212+A_213+A_133+A_123+A_131+A_132+A_121+A_122+A_111+A_112+A_113

(3)

If I modify p (I make it twice its initial value), then this does not affect the value of q and r

p := proc (i, j) options operator, arrow; 2*(sum('cat(A, _, i, j, k)', 'k' = 1 .. 3)) end proc

proc (i, j) options operator, arrow; 2*(sum('cat(A, _, i, j, k)', 'k' = 1 .. 3)) end proc

(4)

q := proc (i) options operator, arrow; sum('p(i, j)', 'j' = 1 .. 3) end proc

proc (i) options operator, arrow; sum('p(i, j)', 'j' = 1 .. 3) end proc

(5)

r := sum('q(i)', 'i' = 1 .. 3)

A_331+A_332+A_333+A_321+A_322+A_323+A_311+A_312+A_313+A_231+A_232+A_233+A_221+A_222+A_223+A_211+A_212+A_213+A_133+A_123+A_131+A_132+A_121+A_122+A_111+A_112+A_113

(6)

Why?
Even if I  unassign p, q and r, this does not work, either.

unassign('p', 'q', 'r')

p := proc (i, j) options operator, arrow; 2*(sum('cat(A, _, i, j, k)', 'k' = 1 .. 3)) end proc

proc (i, j) options operator, arrow; 2*(sum('cat(A, _, i, j, k)', 'k' = 1 .. 3)) end proc

(7)

q := proc (i) options operator, arrow; sum('p(i, j)', 'j' = 1 .. 3) end proc

proc (i) options operator, arrow; sum('p(i, j)', 'j' = 1 .. 3) end proc

(8)

r := sum('q(i)', 'i' = 1 .. 3)

A_331+A_332+A_333+A_321+A_322+A_323+A_311+A_312+A_313+A_231+A_232+A_233+A_221+A_222+A_223+A_211+A_212+A_213+A_133+A_123+A_131+A_132+A_121+A_122+A_111+A_112+A_113

(9)

Only if I restart, then I can modify p and change the rest of values

restart

p := proc (i, j) options operator, arrow; 2*(sum('cat(A, _, i, j, k)', 'k' = 1 .. 3)) end proc

proc (i, j) options operator, arrow; 2*(sum('cat(A, _, i, j, k)', 'k' = 1 .. 3)) end proc

(10)

q := proc (i) options operator, arrow; sum('p(i, j)', 'j' = 1 .. 3) end proc

proc (i) options operator, arrow; sum('p(i, j)', 'j' = 1 .. 3) end proc

(11)

r := sum('q(i)', 'i' = 1 .. 3)

2*A_332+2*A_333+2*A_323+2*A_331+2*A_313+2*A_321+2*A_322+2*A_311+2*A_312+2*A_231+2*A_232+2*A_233+2*A_221+2*A_222+2*A_223+2*A_212+2*A_213+2*A_211+2*A_131+2*A_132+2*A_133+2*A_121+2*A_122+2*A_123+2*A_111+2*A_112+2*A_113

(12)

``

``


 

Download problem_with_sums.mw

Hello,

My name is Francisco Navarro. I have a problem when using diff and alias, together with seq or sum.

A very simplified worksheet of what I mean would be

restart

alias(a1 = a1(r), a2 = a2(r), a3 = a3(r))

array1 := [a1, a2, a3]

array2 := [seq(cat(a, i), i = 1 .. 3)]

array1 - array2

This gives [0,0,0] so they are the same thing but, under differentiation, they do not behave the same way (so they are NOT exactly the same object for Maple)

diff(array1, r)

diff(array2, r)

which are different. Any idea of what is wrong with this?

I need to create long arrays with funcions that depend on several values and then differentiate those arrays. But clearly this approach does not work. Thank you for your answer.

Francisco

Page 1 of 1