# Problem with integration

Hi. The problem is present with W10 SageMath notebook 9.1. The calcul take long time (+ one heure) and i don't get the results

var('z,w,x,om')
E1=200
nu=0.33
rho1=7850
Pi=pi.n()
ah=5
e0=0.25
h=1/ah
em=1-sqrt(1-e0)
aa=Pi*z/(2*h)+Pi/(4);
Ez=E1*(1-e0*(cos(aa)));
rhoz=rho1*(1-em*(cos(aa)));
Q11=Ez;
A11=integral(Q11,z,-h/2,h/2);
B11=integral(Q11*z,z,-h/2,h/2);
D11=integral(Q11*z^2,z,-h/2,h/2);
rhoz1=rhoz
rhoz2=rhoz*z
rhoz3=rhoz*z**2
I0=rhoz1.integral(z,-h/2,h/2);
I1=rhoz2.integral(z,-h/2,h/2);
I2=rhoz3.integral(z,-h/2,h/2);
e1=-I0*om^2/A11;
e2=I1*om^2/A11;
e3=B11/A11;
e4=-(B11*e1+I1*om^2)/(B11*e3-D11);
e5=-I0*om^2/(B11*e3-D11);
e6=(I2*om^2-B11*e2)/(B11*e3-D11);

edit retag close merge delete

Sort by ยป oldest newest most voted

It seems that integral never returns in this use case, at least with Maxima's (default) integrator. This is a bug (now Trac#31351).

Workaround : use algorithm="sympy", which seems to be exempt of this particular quirk.

Or use numerical integration (the current code uses symbolic integration with numerical rather than symbolic constants).

EDIT : Further exploration shows that the problem is Maxima's (see ticket...).

EDIT : Problem reported upstream (see ticket...).

more

( 2021-02-07 10:41:00 +0200 )edit