pwint in package pw.mac



That is a bug, actually 2 bugs.  I have put in place a quick fix the pwdefint() function but now pwdefint(g(x),x, a, b) requires a 
<= b so

pwdefint(g(x),x,b,a) # pwdefint(g(x),x,a,b)

The pwint problem is also fixed.  pwint by the way does not compute definite integrals because I did not want users expecting pwint 
to handle principle values integrals which it does not do very well.

Now I get

(%i1) load(pw)$
(%i2) display2d:false;
(out2) false
(%i3) g(x) := pw([-inf,-x^2,0,7*x^2,inf], x,'open)
(%i4) pwdefint(g(x),x,1,2);
(out4) 49/3
(%i5) integrate( 7*x^2, x,1,2 );
(out5) 49/3
(%i6) define( F(t), pwint(g(t), t) );
(out6) F(t):=4*t^3*signum(t)/3+t^3
(%i7) F(2)-F(1);
(out7) 49/3

Thanks for pointing this out.  Yes, it would be nice to have some repository for packages
under development or experimentation.  That has been brought up before but I don't know if that is going to happen.

You can get pw.mac from this link.
http://mysite.verizon.net/res11w2yb/id2.html
or
http://mysite.verizon.net/res11w2yb/pw.txt


Rich

----- Original Message ----- 
From: "Krzysztof Lesniak" <much at mat.uni.torun.pl>
To: <maxima at math.utexas.edu>
Sent: Monday, June 08, 2009 7:26 AM
Subject: pwint in package pw.mac


Dear users!
I have a problem with using package pw.mac.
------------------------------------------------------
load("pw/pw.mac")$
g(x) := pw([-inf,-x^2,0,7*x^2,inf], x,'open)$

(%i1) pwdefint( g(x), x,1,2 );
(%i2) integrate( 7*x^2, x,1,2 );
(%i3) define( F(t), pwint(g(t), t) );
(%i4) F(2)-F(1);

(%o1) 50/3
(%o2) 49/3
(%o3) F(t):=t^3
(%o4) 7
------------------------------------------------------
1) What's going on above?
Probably I use "define" in a wrong way,
getting output to %i3 & %i4 not consistent with %i1 & %i2.
Nevertheless I expected %o1=%o2.
Playing "open" option in "pw" doesn't cure the situation.

I just wanted to calculate definite intergrals of some tooth-functions
(possibly multiplied by standard functions e.g. exp).
[These integrals represent payoff functionals...]

2) Additionally, "pwint" didn't want to calculate definite integrals
(hence I'm bound to "pwdefint").

3) Finally, the webpages were I could download the desired
pw.mac package were outdated or (temporarily) out of service,
including the newest one of the author of this package.
It would be nice to have some repository for packages
under development or experimentation.

Thank you for the answers given to all my previous questions.
Excuse me if I was unaware of some points in the earlier discussion
about pw.mac.

Best regards
- Krzysztof Lesniak


_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima