Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6276 > unrolled thread
| Started by | Xiaojun <tigertooth4@gmail.com> |
|---|---|
| First post | 2011-11-08 12:23 +0000 |
| Last post | 2011-11-12 12:41 +0000 |
| Articles | 5 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
How to use SeriesCoefficient to define new functions Xiaojun <tigertooth4@gmail.com> - 2011-11-08 12:23 +0000
Re: How to use SeriesCoefficient to define new functions Xiaojun <tigertooth4@gmail.com> - 2011-11-09 11:39 +0000
Re: How to use SeriesCoefficient to define new functions Simon <simonjtyler@gmail.com> - 2011-11-10 12:01 +0000
Re: How to use SeriesCoefficient to define new functions Dan <dflatin@rcn.com> - 2011-11-10 12:11 +0000
Re: How to use SeriesCoefficient to define new functions Xiaojun <tigertooth4@gmail.com> - 2011-11-12 12:41 +0000
| From | Xiaojun <tigertooth4@gmail.com> |
|---|---|
| Date | 2011-11-08 12:23 +0000 |
| Subject | How to use SeriesCoefficient to define new functions |
| Message-ID | <j9b6vs$4u6$1@smc.vnet.net> |
Hi,
I want to define new functions from the =EB-expansion of an exponential
function as follows:
SchurGenerator := Normal[Series[ Exp[x1*=EB + x2*=EB^2 + x3*=EB^3], {=EB, 0,
3}]].
Each coefficient may define a function of x1, x2, and x3, which I
think should be expressed
as, for example:
p2[x1_, x2_, x3_] := SeriesCoefficient[SchurGenerator, {=EB, 0, 2}].
However, it doesn't seem to work. Since the expected output of
p2[y1,y2,y3] should be
y1^2/2 + y2. But the real output is still x1^2/2 + x2.
How to define new functions from the expansion coefficients? I
appreciate your help !
--
Best wishes,
Liu Xiaojun
[toc] | [next] | [standalone]
| From | Xiaojun <tigertooth4@gmail.com> |
|---|---|
| Date | 2011-11-09 11:39 +0000 |
| Message-ID | <j9doq6$b6c$1@smc.vnet.net> |
| In reply to | #6276 |
Sorry for the unicode character issue: "=EB" should be greek letter
"lambda". Thanks in advance!
On Nov 8, 8:23 pm, Xiaojun <tigertoo...@gmail.com> wrote:
> Hi,
>
> I want to define new functions from the =EB-expansion of an exponential
> function as follows:
>
> SchurGenerator := Normal[Series[ Exp[x1*=EB + x2*=EB^2 + x3*=EB^3=
], {=EB, 0,
> 3}]].
>
> Each coefficient may define a function of x1, x2, and x3, which I
> think should be expressed
> as, for example:
>
> p2[x1_, x2_, x3_] := SeriesCoefficient[SchurGenerator, {=EB, 0, 2}=
].
>
> However, it doesn't seem to work. Since the expected output of
> p2[y1,y2,y3] should be
>
> y1^2/2 + y2. But the real output is still x1^2/2 + x2.
>
> How to define new functions from the expansion coefficients? I
> appreciate your help !
>
> --
> Best wishes,
> Liu Xiaojun
[toc] | [prev] | [next] | [standalone]
| From | Simon <simonjtyler@gmail.com> |
|---|---|
| Date | 2011-11-10 12:01 +0000 |
| Message-ID | <j9gefc$oue$1@smc.vnet.net> |
| In reply to | #6300 |
Hi Liu Xiaojun,
You don't need to uses Series before you uses SeriesCoefficient.
SeriesCoefficient can actually return the general coefficient as a DifferenceRoot object. So you could simply use the following:
p[n_][x1_, x2_, x3_] :=
Block[{k}, SeriesCoefficient[Exp[x1*k + x2*k^2 + x3*k^3], {k, 0, n}]]
I've used k instead of lambda and I've wrapped the right-hand-side in Block, just in case k has a value already. The first 10 functions can be found using
Table[p[i][x, y, z], {i, 1, 10}] // Simplify
Note: your original code will work if change your SetDelayed := to just Set
p2[x1_, x2_, x3_] = SeriesCoefficient[SchurGenerator, {\[Lambda], 0, 2}]
Simon
[toc] | [prev] | [next] | [standalone]
| From | Dan <dflatin@rcn.com> |
|---|---|
| Date | 2011-11-10 12:11 +0000 |
| Message-ID | <j9gf1h$p6l$1@smc.vnet.net> |
| In reply to | #6276 |
On Nov 8, 7:23 am, Xiaojun <tigertoo...@gmail.com> wrote:
> Hi,
>
> I want to define new functions from the =EB-expansion of an exponential
> function as follows:
>
> SchurGenerator := Normal[Series[ Exp[x1*=EB + x2*=EB^2 + x3*=EB^3], {=EB, 0,
> 3}]].
>
> Each coefficient may define a function of x1, x2, and x3, which I
> think should be expressed
> as, for example:
>
> p2[x1_, x2_, x3_] := SeriesCoefficient[SchurGenerator, {=EB, 0, 2}].
>
> However, it doesn't seem to work. Since the expected output of
> p2[y1,y2,y3] should be
>
> y1^2/2 + y2. But the real output is still x1^2/2 + x2.
>
> How to define new functions from the expansion coefficients? I
> appreciate your help !
>
> --
> Best wishes,
> Liu Xiaojun
Liu, your problem is that your definition for SchurGenerator uses the
literal symbols x1, x2, and x3. If you want to define it so that you
substitute a different symbol when called you will have to use
patterns, as in
SchurGenerator[x1_,x2_,x3_]:=Normal@Series[Exp[x1*lambda + x2*lambda^2
+ x3*lambda^3],{lambda,0,3}]
so that p2 becomes
p2[x1_,x2_,x3_]:=SeriesCoefficient[SchurGenerator[x1,x2,x3],{lambda,
0,2}]
[toc] | [prev] | [next] | [standalone]
| From | Xiaojun <tigertooth4@gmail.com> |
|---|---|
| Date | 2011-11-12 12:41 +0000 |
| Message-ID | <j9lpih$li2$1@smc.vnet.net> |
| In reply to | #6351 |
Simon and Dan, thank you all for your answers:) my problem solved!
On Nov 10, 8:11 pm, Dan <dfla...@rcn.com> wrote:
> On Nov 8, 7:23 am, Xiaojun <tigertoo...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > Hi,
>
> > I want to define new functions from the =EB-expansion of an exponential
> > function as follows:
>
> > SchurGenerator := Normal[Series[ Exp[x1*=EB + x2*=EB^2 + x3*=EB^3], {=EB, 0,
> > 3}]].
>
> > Each coefficient may define a function of x1, x2, and x3, which I
> > think should be expressed
> > as, for example:
>
> > p2[x1_, x2_, x3_] := SeriesCoefficient[SchurGenerator, {=EB, 0, 2}].
>
> > However, it doesn't seem to work. Since the expected output of
> > p2[y1,y2,y3] should be
>
> > y1^2/2 + y2. But the real output is still x1^2/2 + x2.
>
> > How to define new functions from the expansion coefficients? I
> > appreciate your help !
>
> > --
> > Best wishes,
> > Liu Xiaojun
>
> Liu, your problem is that your definition for SchurGenerator uses the
> literal symbols x1, x2, and x3. If you want to define it so that you
> substitute a different symbol when called you will have to use
> patterns, as in
>
> SchurGenerator[x1_,x2_,x3_]:=Normal@Series[Exp[x1*lambda + x2*lambda^2
> + x3*lambda^3],{lambda,0,3}]
>
> so that p2 becomes
>
> p2[x1_,x2_,x3_]:=SeriesCoefficient[SchurGenerator[x1,x2,x3],{lambda,
> 0,2}]
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web