Re: [GiNaC-list] Problem about series
I am sorry for that I didn't make it clear. the test program shows that s1 output is Order(ep^(-1)), there is no other term in the output, so s1 output indicates that there is no ep^(-2) in expr, I am not sure I interpret the s1 output correctly or not? PS: from s2 output indicates that there is an ep^(-2) term in expr. Thanks very much! Best Regards! Feng
-----原始邮件----- 发件人: ginac-list-request@ginac.de 发送时间: 2019-04-12 18:00:03 (星期五) 收件人: ginac-list@ginac.de 抄送: 主题: GiNaC-list Digest, Vol 140, Issue 5
Send GiNaC-list mailing list submissions to ginac-list@ginac.de
To subscribe or unsubscribe via the World Wide Web, visit https://www.cebix.net/mailman/listinfo/ginac-list or, via email, send a message with subject or body 'help' to ginac-list-request@ginac.de
You can reach the person managing the list at ginac-list-owner@ginac.de
When replying, please edit your Subject line so it is more specific than "Re: Contents of GiNaC-list digest..."
Today's Topics:
1. Re: Problem about series (Richard B. Kreckel)
----------------------------------------------------------------------
Message: 1 Date: Thu, 11 Apr 2019 23:29:23 +0200 From: "Richard B. Kreckel" <kreckel@in.terlu.de> To: ginac-list@ginac.de Subject: Re: [GiNaC-list] Problem about series Message-ID: <920c06c9-7a44-f2eb-43d3-2b46adbae6e6@in.terlu.de> Content-Type: text/plain; charset=utf-8
Feng Feng,
Sorry, I don't see what's wrong with this.
On 08.04.19 01:00, Feng Feng wrote:
Hi, I got a problem ?about the series function, I used the following test code(see below or the attached file), the s1 output only gives Order(ep^(-1)), while s2 output indicates that there is a 1/ep^2 term, so the s1 is not correct or I used the series in a wrong way?
Thanks a lot!
#include <ginac/ginac.h>
using namespace GiNaC; using namespace std;
int main(int argn, char** args) { ? ? symbol x1("x1"),x2("x2"),x3("x3"),x4("x4"); ? ? symbol ep("ep"); ? ? ex expr = -2*pow(x1,-1 + ep)*(exp(3*ep*Euler)*pow(ep,-1)*pow(x2,-3*ep)* ? ? ? pow(1 + x3 + x4 + x3*x4,-3*ep)* ? ? ? pow(1 + x2 + x3 + x2*x3 + x4 + x2*x4 + x3*x4 + x2*x3*x4,-2 + 4*ep)*tgamma(3*ep) - ? ? ?exp(3*ep*Euler)*pow(ep,-1)*pow(x2,-3*ep)*pow(1 + x3 + x4 + x3*x4,-3*ep)* ? ? ? pow(1 + x2 + x3 + x1*x3 + x2*x3 + x4 + x2*x4 + x3*x4 + x1*x3*x4 + x2*x3*x4, ? ? ? ?-2 + 4*ep)*tgamma(3*ep)); ? ?? ? ? auto s1 = expr.series(ep,-1); ? ? cout << s1.normal() << endl; ? ?? ? ? auto s2 = expr.series(ep,0); ? ? cout << s2.normal() << endl; ? ?? ? ? return 0; }
You did notice that this Laurent series is expanded in ep, not in ep^-1, right?
It might help if you reduce your example program to the bare minimum. Then, if you still think it's wrong, please explain what exactly you expected instead of the output you got and why.
All my best, -richy. -- Richard B. Kreckel <https://in.terlu.de/~kreckel/>
------------------------------
Subject: Digest Footer
_______________________________________________ GiNaC-list mailing list GiNaC-list@ginac.de https://www.cebix.net/mailman/listinfo/ginac-list
------------------------------
End of GiNaC-list Digest, Vol 140, Issue 5 ******************************************
Feng Feng, On 13.04.19 07:06, Feng Feng wrote:
I am sorry for that I didn't make it clear.
the test program shows that s1 output is Order(ep^(-1)), there is no other term in the output, so s1 output indicates that there is no ep^(-2) in expr, I am not sure I interpret the s1 output correctly or not?
I'm sure you interpret it correctly. There is indeed a bug in GiNaC. A reduced example of the same problem is this: symbol x("x"), ep("ε"); ex expr = x * (tgamma(ep) / ep - sin(ep) / ep); cout << expr.series(ep, -2) << endl; // good: Order(ε^(-2)) cout << expr.series(ep, -1) << endl; // D'oh: Order(ε^(-1)) cout << expr.series(ep, 0) << endl; // good: (x)*ε^(-2)+(-Euler*x)*ε^(-1)+Order(1) It seems it was broken by commit db81420a61 in 2004. Best, -richy.
participants (2)
-
Feng Feng
-
Richard B. Kreckel