Re: making a function linear
- To: mathgroup at smc.vnet.net
- Subject: [mg25491] Re: [mg25473] making a function linear
- From: Ken Levasseur <Kenneth_Levasseur at uml.edu>
- Date: Thu, 5 Oct 2000 23:50:12 -0400 (EDT)
- Organization: UMass Lowell
- References: <200010030226.WAA06503@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Murray:
The only approach I can think of uses Hold. I understand what you mean
about tring to avoid using some variation of Hold, but in a way that
mirrors some of the problems I've had teaching students linear algebra.
The impulse is to look at cx+y as a single vector to be mapped by T.
You want them to look at it as a pattern or form; so maybe Hold is
really natural.
Ken Levasseur
UMass Lowell
Murray Eisenberg wrote:
>
> For a function T not yet having any "definition by formula" (T[x_] :=
> ..... ), I want to specify the linearity rules:
>
> T[x_?VectorQ + y_?VectorQ] := T[x] + T[y]
>
> T[c_ x_?VectorQ] := c T[x]
>
> Then, merely by specifying, say,
>
> a = {1, 2}; T[a] = {3, 4};
> b = {5, 6}; T[b] = {7, 8};
>
> evaluating
>
> T[2 a]
> T[a + b]
>
> would return results:
>
> {6, 8}
> {10, 12}
>
> The trouble is, of course, that Mathematica first evaluates 2 a and a +
> b when a and b have actual numeric values, so the two linearity rules
> never get used.
>
> What is a SIMPLE way (if there is one) to accomplish this -- preferably
> some way to do it that does not explicitly require using some Hold
> variant? (I need to be able to explain how to do it early in a linear
> algebra course where Mathematica is being introduced, and Hold, etc., I
> consider a definitely advanced topic.)
>
> --
> Murray Eisenberg murray at math.umass.edu
> Mathematics & Statistics Dept. phone 413 549-1020 (H)
> Univ. of Massachusetts 413 545-2859 (W)
> Amherst, MA 01003-4515
- References:
- making a function linear
- From: Murray Eisenberg <murray@math.umass.edu>
- making a function linear