Simplifying output involving heaviside discontinuity functions

2 views (last 30 days)
I wrote a program to find the discontinuity function of a beam. The output for the shear function was
f = (12*heaviside(x - 5/2) - 12*heaviside(x - 7/2))*x^2 + (84*heaviside(x - 7/2)...
- 60*heaviside(x - 5/2) - 24*heaviside(x - 1))*x + 75*heaviside(x - 5/2) - 12*heaviside(x - 1)...
- 109*heaviside(x - 7/2) + 46*heaviside(x)
How can the output be simplified so that there are no terms such as heaviside(x - 7/2)*x^2 where the heaviside function is shifted to the right by 7/2 but the function the heaviside function is multiplied by is not shifted by the same amount? For example, the above function is equivalent to
f = 46*heaviside(x)- 36*heaviside(x-1) - 24*heaviside(x-1).*(x-1) + 12*(heaviside(x-2.5).*(x-2.5).^2...
- heaviside(x-3.5).*(x-3.5).^2)+38*heaviside(x-3.5).*(x-3.5)

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!