I have a symbolic solution to a linear system with respect to some variables a[i,j] which depend on a parameter t.
sol=Solve[...,Table[a[i,j],{i,0,n},{j,0,n}]]
I would like to make functions from the solutions. Something like
a[i,j][t_]:=a[i,j]/.sol[[1]]
When I do it by hand, everything is fine. But when I try to get it in any loop, like
Do[{a[i, j][t] := a[i, j] /. sol[[1]]}, {i, 0, n}, {j, 0, n}]
it doesn't work.
For example, when I'm trying to look at a[0,1][t] it gives me
a[i,j]
How can one define a family of functions in a loop?
Tablerather thanDo. – Verbeia Aug 09 '13 at 07:00HoldAllattribute. If you change:=to=it works. This enables evaluation of the RHS. Additionally, in the definition you probably should changettot_. – Sjoerd C. de Vries Aug 09 '13 at 22:45(#1[t_] := Evaluate[#2]) & @@@ First[sol]. Hard to be sure without a working example to test it on.. – Michael E2 Aug 10 '13 at 01:59