matlabwolfram-mathematicanumerical-integrationintegral

MATLAB not evaluating integral


MATLAB gives me the same expression back. Here's my code

syms tau alpha phi
f = sign(alpha*cos(phi))*(abs(alpha*cos(phi)) - 2.5*(alpha*cos(phi))^2);
F=f*sin(phi);
int(F,phi, [pi/2, acos(tau/alpha)])

I did plug in the values of variables tau and alpha but it still gives me the same expression back. Anyone know how to solve it? Or some other numerical method which could give me answer in these symbols? Will wolfram-mathematica help?


Solution

  • Mathematica

    Integrate[(Sign[alpha*Cos[phi]]*(Abs[alpha*Cos[phi]] - 5/2*
      (alpha*Cos[phi])^2))*Sin[phi], {phi, Pi/2, ArcCos[tau/alpha]}]
    

    (* ConditionalExpression[-(tau^2/(2 alpha)) + (5 alpha^3 Abs[tau]^3)/ (6 Abs[alpha]^4), ArcCos[tau/alpha] \[Element] Reals] *)

    Thus the result is the expression inside the ConditionalExpression if the ArcCos[tau/alpha] is an element of the reals.

    If you could specify something like -1<=tau/alpha<=1 && 0<=tau then it can provide an even simpler result, (tau^2 (-3 + 5 tau))/(6 alpha)

    Please verify this before you depend on it.