How can I make a graphical integration?

Hi guys I need help with graphical integration.
I have got data:
M = [82704 -107654 -151679 -36317 65017 149325 155528 26497 -47232 -30685 15002 88192 194927 226705 82704];
Angle = [0 15 30 60 90 120 150 180 210 240 270 300 330 345 360];
where M is moment of force [Nm] and Angle is angle of rotation [deg]
and I need to get graph of integration around value M=47535 Nm.
I have already solved numerical integration, but it is not enough for me. I need to get a graph of work [J] on y-axis and angle [deg] on x-axis with smooth curve.
I have tried to use cumtrapz but with nonsencial results.
Is here anybody who is able to help me?
Btw sorry for mistakes in English, not native.
I have already made this, but it is not working good...
M = [82704 -107654 -151679 -36317 65017 149325 155528 26497 -47232 -30685 15002 88192 194927 226705 82704];
Angle = [0 15 30 60 90 120 150 180 210 240 270 300 330 345 360];
figure
plot(Angle,M,'-*')
grid on
title('Moment')
xlabel('Angle[deg]')
ylabel('Moment[Nm]')
cmoment = cumtrapz(M);
M = table (Angle',cmoment','VariableNames',{'Angle','Work'})
plot(cmoment)
title('Work')

 Accepted Answer

What do you mean by "integration around value M = 47535". There several intersections:
img.png
a1 = linspace(min(A),max(A),100); % mesh for angle
m1 = spline(A,M,a1); % moment values
plot(a1,cumtrapz(a1,m1))
img1.png

7 Comments

Hi,
it can be just a mistake of my misunderstanding the principle of graphical integration.What I found in my sources is: "Graphical integration - It determines the average (in this case M=47535) and the sizes of surfaces are rendered".
I am a bit confused about values of the moment (=x*10^5) and work (=x*10^7) because I have got some solved examples and there is work lower than moment everywhere, so I am going to try and find out...
Can I get a full script of a moment graph from U also please?
Thanks.
Sure
I considered that work can be negative (minus sign)
Thanks for the script.
There is no problem that work is negative. But I think there is a problem with dimension. The highest value of the moment is like Mmax = 2.26*10^5 Nm and the highest value of the work is about Amin = 1.5*10^7 J and it doesn't make sense for me. How i wrote before I have got some solved examples and there is Mmax = 120 Nm and Amax = 90 J in the first case and Mmax = 230Nm, Amax = -191J in the second case. So I am a bit worried and confused about these values with big difference...
Try to convert units:
A = pi/180*A; % angle in radians
M = 1E-3*M; % moment in N*mm
% average work/moment per RADIAN
J1 = trapz(A,M)/2/pi; % original data integration
J2 = trapz(a1,m1)/2/pi; % smoothed data integration
When I use angle in radians it makes much more sense and the values seem also good.
I am still a bit uncertain about the end of the curve because I think that the values should fall down but not sure at all about that.
Anyway thank you for help. Helped me a lot.
the moment at the end is with "+" sign. How the work can fall down?
Im going for Most Valuable Person
can you accept the question please?

Sign in to comment.

More Answers (0)

Categories

Find more on Numerical Integration and Differential Equations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!