Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Matrix Operator form using Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53226] Re: Re: Matrix Operator form using Mathematica
  • From: "Steve Luttrell" <steve_usenet at _removemefirst_luttrell.org.uk>
  • Date: Sat, 1 Jan 2005 02:33:46 -0500 (EST)
  • References: <cqtc4e$7ic$1@smc.vnet.net> <200412300638.BAA23335@smc.vnet.net> <cr33o5$jcn$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

You can do what you want by using Inner (have a look at its general 
definition in the Help Browser) to implement a dot product that contracts a 
matrix-valued operator with a vector-valued object.

Here is an example for matrix-valued operator 
{{o11[#]&,o12&[#]},{o21[#]&,o22&[#]}} and vector-valued object {v1,v2}.

Inner[#1[#2]&,{{o11[#]&,o12&[#]},{o21[#]&,o22&[#]}},{v1,v2},Plus]

which gives the required result

{o11[v1]+o12[v2],o21[v1]+o22[v2]}

NOTE: this assumes that there is nothing else to the right of the 
vector-valued object that needs to be operated on as well (e.g. quantum 
mechanics would typically fall into this class of problem).

You can substitute any operators you want in place of the oij above. A 
vector example that does the sort of thing you want is:

Inner[#1[#2]&,{{-#&,0#&},{0#&,D[#,{x,2}]&}},{Log[x],Tan[x]},Plus]

which gives the result

{-Log[x], 2*Sec[x]^2*Tan[x]}

Once you have a standard vector-valued object (i.e. no operator-valuedness 
left over) you can manipulate it in the standard way using Inner (and Dot) 
and Outer. For instance, you want to make a matrix out of a pair of vectors. 
This is an outer product which can be done thus

Outer[Times, vector1, vector2]

Steve Luttrell

"Pratik Desai" <pdesai1 at umbc.edu> wrote in message 
news:cr33o5$jcn$1 at smc.vnet.net...
> Thanks Steve for your response,
>
> What if the matrix operates on a vector,
> aone1=aone[{Tan[x],1}];
> VectorQ[aone1]
>
> Output:
> False
>
> Actually when the matrix aone operates on a 2*1 vector, it should give me
> another 2*1 vector,--I then want to multiply this new vector to another 
> row
> vector to give me back a matrix. Is this possible
>
> Thanks again,
>
> Pratik
>
>
>
>
>
> ------ Original Message ----- 
> From: "Steve Luttrell" <steve_usenet at _removemefirst_luttrell.org.uk>
To: mathgroup at smc.vnet.net
> Subject: [mg53226]  Re: Matrix Operator form using Mathematica
>
>
>> Oops! I missed out a # from my first reply:
>>
>> One way to do this is to define a matrix-valued function
>>
>> aone={{-#,0},{0,D[#,{x,2}]}}&
>>
>> so that (for instance) evaluating
>>
>> aone[Tan[x]]
>>
>> gives the result
>>
>> {{-Tan[x], 0}, {0, 2*Sec[x]^2*Tan[x]}}
>>
>> Steve Luttrell
>>
>> "Pratik Desai" <pdesai1 at umbc.edu> wrote in message
>> news:cqtc4e$7ic$1 at smc.vnet.net...
>>>
>>> Hello all,
>>>
>>> How do I define an operator embedded in a matrix and functions
>>> as...well........an operator
>>>
>>> azero={{0,1},{1,0.05}};
>>> aone={{-1,0},{0,(k)}};
>>> (*k is the second order differential operator with respect to x d,xx, Is
>>> there a way to define this in mathematica *)
>>>
>>>
>>> Thanks
>>>
>>> Pratik Desai
>>>
>>
>>
> 



  • Prev by Date: Re: How to draw a trajectory in DensityPlot&#65311;
  • Next by Date: Re: 2D plot for lists?
  • Previous by thread: Re: Re: Re: Matrix Operator form using Mathematica
  • Next by thread: Mercator projection from http://mathworld.wolfram.com/MercatorProjection.html with missing earth.pts