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.matlab

Topic: symbolic integration problem by change from maple->mupad kernel
Replies: 1   Last Post: Sep 27, 2013 5:34 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Christopher Creutzig

Posts: 262
Registered: 2/24/09
Re: symbolic integration problem by change from maple->mupad kernel
Posted: Sep 27, 2013 5:34 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 20.09.13 10:16, Manuel Höger wrote:
> syms x s smin En sigma smax eps;
>
>
> smin=1.16
>
> smax=sym('mp^2+4*eps*En');
>
> sigma =
> sym('(200*(heaviside(s-1.255)*heaviside(1.818-s))+90*(heaviside(s-1.818)*heaviside(3.131-s)))*(s-0.938^2)');


Just as a general remark: Using strings to generate symbolic expressions
is not recommended. Just use

sigma = (200*(heaviside(s-1.255)*heaviside(1.818-s))+ ...
90*(heaviside(s-1.818)*heaviside(3.131-s)))*(s-0.938^2);

instead.

> f=int(sigma,s,smin,smax)
>
>
> In the old version this works without any problems. Is there any
> possibility to do this symbolically with the mupad kernel too?


It seems not to work well with your smax setting, but if you leave smax
abstract, you can get a piecewise defined result:

>> syms x s En sigma smax eps;
>> smin=1.16;
>> sigma = (200*(heaviside(s-1.255)*heaviside(1.818-s))+ ...

90*(heaviside(s-1.818)*heaviside(3.131-s)))*(s-0.938^2);
>> f=int(sigma,s,smin,smax)

f =

int((s - 1981232555272083/2251799813685248)*(200*heaviside(s -
251/200)*heaviside(909/500 - s) + 90*heaviside(s -
909/500)*heaviside(3131/1000 - s)), s == 29/25..smax)

>> simplify(feval(symengine, 'rewrite', f, 'piecewise'))
Warning: Cannot check whether the integrand is defined everywhere on the
integration interval. [defint_b_gr_a]

ans =

piecewise([smax <= 251/200, 0], [3131/1000 <= smax,
7385339457149474345789/28147497671065600000], [smax in
Dom::Interval(251/200, [909/500]), ((200*smax -
251)*(28147497671065600*smax - 14205704304614747))/56294995342131200],
[smax in Dom::Interval(909/500, 3131/1000), 45*smax^2 -
(89155464987243735*smax)/1125899906842624 +
973466582639913688321/14073748835532800000])

>> vpa(ans)

ans =

piecewise([smax <= 1.255, 0.0], [3.131 <= smax,
262.37996512000003497849576206136], [smax in Dom::Interval(1.255,
[1.818]), 0.000000000000000017763568394002504646778106689453*(200.0*smax
- 251.0)*(28147497671065600.0*smax - 14205704304614747.0)], [smax in
Dom::Interval(1.818, 3.131), 45.0*smax^2 -
79.185959999999986358432124688989*smax + 69.16896087999999226674674446258])


Don't let those Dom::Interval confuse you, they just mean 1.255 < smax
<= 1.818 and 1.818 < smax < 3.131, respectively.

(To file an enhancement request for future versions, please contact
MathWorks support, as usual.)


HTH,

Christopher





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.