I have a table (Vector), where each element is an interpolated function by Interpolation[].


Can I evaluate the vector A for fixed time?

I tried to define the vector A like above defined, and evaluated it by: A[0.1]

But the output is the list of interpolation, but not the value of functions at 0.1.

I tried to evaluated for fixed time the generic element of the A, and it seems work.

How can I solve it?

  • $\begingroup$ Your matrix definition does not depend upon $t$. Please fix it. $\endgroup$ – David G. Stork Feb 23 '17 at 0:43

I would use Composition and Through. Using Jack's list of interpolation functions:

list = Table[{θ, Sin[n θ]}, {n, 1, 3}, {θ, 0, 2 π, 2 π/20}];
{f1, f2, f3} = Interpolation /@ list;

Then, you can define A as:

A = Through @* {f1, f2, f3};


A[.1] //N

{0.0999854, 0.203017, 0.32276}

Same result

  • $\begingroup$ Thanks Carl Woll your solution it's that I need;) $\endgroup$ – plus91 Feb 23 '17 at 15:06

You didn't provide list so I'll make a simple one.

list = Table[{θ, Sin[n θ]}, {n, 1, 3}, {θ, 0, 2 π, 2 π/20}];


Mathematica graphics

Now make a table of interpolated function from list.

{f1, f2, f3} = Interpolation[#] & /@ list

Define A[t] in terms of the functions

A[t_] := {f1[t], f2[t], f3[t]}

A[0.1] // N
(* {0.0999854, 0.203017, 0.32276} *)
  • $\begingroup$ Thanks, your solution work, but need a manual definition element of A[t]. In my case is a disanvantage, but this method it is useful the same ;) $\endgroup$ – plus91 Feb 23 '17 at 15:05

@plus91, change your solution a litle bit and it works

    list = Table[{θ, Sin[n θ]}, {n, 1, 3}, {θ, 0, 2 π, 2 π/20}];

    A[t_] = Table[Interpolation[list[[i]]][t], {i, 1, 3}]


    (*   {0.0999854, 0.203017, 0.32276}  *)
  • $\begingroup$ Thx for your solution ;) $\endgroup$ – plus91 Feb 23 '17 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.