# Question:How to improve calculation speed?

## Question:How to improve calculation speed?

Maple

hi,i am studying the maple most recent.But when calculating function integral，I ran into trouble.I hope to get your help.Here is the code I wrote, but it runs a very long time. How to effectively reduce the integration time?

restart;
with(student);
assume(n::integer);
Fourierf := proc (sigma, a, b, N) local A, A0, B, T, S, Ff; T := b-a; A0 := int(sigma, t = a .. b); A := int(sigma*sin(n*Pi*t/T), t = a .. b); B := int(sigma*cos(n*Pi*t/T), t = a .. b); S := sum(A*sin(n*Pi*t/T)+B*cos(n*Pi*t/T), n = 1 .. N)+(1/2)*A0; Ff := unapply(S, t) end proc;

f := proc (t) options operator, arrow; piecewise(t < .13*2.6 and 0 <= t, 100*t/(.13*2.6), .13*2.6 <= t and t < 2.6, 100, 2.6 <= t and t < 2.6*1.1, 0) end proc;

sigma := f(t);
a := 0;
b := 1.1*2.6;
s1 := unapply((Fourierf(sigma, a, b, 500))(t)/uw0, t);

s2 := unapply((Fourierf(sigma, a, b, 500))(t)/ua0, t);
A1 := (2*n+1)^2*Pi^2*(C3+1+sqrt(4*C1*C2*C3+C3^2-2*C3+1))/(8*C1*C2-8);
A2 := (2*n+1)^2*Pi^2*(C3+1-sqrt(4*C1*C2*C3+C3^2-2*C3+1))/(8*C1*C2-8);
g := -C2*Cww*(diff(s1(x), `\$`(x, 2)))+Caa*(diff(s2(x), `\$`(x, 2))+(n+1/2)^2*Pi^2*(diff(s2(x), x)));
f1 := -(1/2)*(n+1/2)^2*Pi^2*sqrt(4*C1*C2*C3+C3^2-2*C3+1)+C2*Cww*((D@@1)(s1))(0)-Caa*((D@@1)(s2))(0)+(n+1/2)^2*Pi^2*(C2-(1/2)*C3+1/2);

CN := ((2*(int(exp(-A1*x)*g, x = 0 .. t)-f1))*exp(A1*t)-(2*(int(exp(-A2*x)*g, x = 0 .. t)-f1))*exp(A2*t))/((n+1/2)^3*Pi^3*sqrt(4*C1*C2*C3+C3^2-2*C3+1));
ua := sum(CN*sin((n+1/2)*Pi*z), n = 0 .. 100);

﻿