15 Reputation

One Badge

0 years, 276 days

MaplePrimes Activity

These are replies submitted by physicist137

@physicist137  by u I meant x.

@acer  Yes, the example I gave was just for the purpose of illustrating. Actually, I am dealing with some functional systems of equations that are represented by some huge matrix A. I would like to assign some elements of the matrix, say a[i,j](x), which until now were not assigned, to some complicated functions b[i,j](x) which are different for each pair of indexes i and j. These expressions are solutions of certain equations.

For example, suppose that I want to assign to the diagonal elements a[i ,i ](x) of a 9x9 matrix A, the expressions a[i,i] := x-> exp(alpha[i,i]*x). The code

for i from 1 to 9 do a[i,i] := u-> exp(alpha[i,i]*x); od;

didn't work, it returned, for example, a[3,3](u) = exp(alpha[10,10]*x), etc. But using the unapply command as you indicated, i.e., from the code

for i from 1 to 9 do a[i,i]:=unapply( exp(alpha[i,i]*x), u);od;

worked perfectly to me.

The other way you indicated is interesting as well, but for this specific problem, the older way worked fine and it seems simpler to me, so I'm using it.

Thank you once again!

Thank you very much @acer. It worked perfectly! 

Page 1 of 1