Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: keep special functions unexpanded
Replies: 1   Last Post: Jul 21, 2013 4:14 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Bob Hanlon

Posts: 906
Registered: 10/29/11
Re: keep special functions unexpanded
Posted: Jul 21, 2013 4:14 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


t = Table[
{ChebyshevT[ToString[i], x], ChebyshevT[i, x]},
{i, 0, 2}]


{{ChebyshevT["0", x], 1},
{ChebyshevT["1", x], x},
{ChebyshevT["2", x], -1 + 2*x^2}}


t /. i_String :> ToExpression[i]


{{1, 1}, {x, x}, {-1 + 2*x^2, -1 + 2*x^2}}



Bob Hanlon




On Sat, Jul 20, 2013 at 5:58 AM, metrologuy <takacs@bnl.gov> wrote:

> I am trying to create a list of ChebyshevT[n,x] polynomials of different
> orders to use as basis functions in a fitting routine. I want to keep the
> list in the form that explicitly shows the order number. For example, I
> want the list for order n=2 to look like this:
> basislist={ChebyshevT[0,x],ChebyshevT[1,x],ChebyshevT[2,x]}.
> If I use Table to generate the list, I get each function expanded into a
> polynomial in x:
>
> In[1]:= Table[ChebyshevT[i,x],{i,0,2}]
>
> Out[1]= {1,x,-1+2 x^2}
>
> How can I prevent the function from displaying the expanded form for each
> value of n? If I use the unexpanded form in the Fit[] function, it works
> just fine. But I lose the visual connection to the explicit order number in
> the input form of the function. Any suggestions how to keep the "n" visible?
>
>





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.