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')

 Respuesta aceptada

darova
darova el 24 de Abr. de 2019
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 comentarios

Karel Horký ml
Karel Horký ml el 24 de Abr. de 2019
Editada: Karel Horký ml el 24 de Abr. de 2019
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.
darova
darova el 24 de Abr. de 2019
Sure
I considered that work can be negative (minus sign)
Karel Horký ml
Karel Horký ml el 24 de Abr. de 2019
Editada: Karel Horký ml el 24 de Abr. de 2019
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
Karel Horký ml
Karel Horký ml el 25 de Abr. de 2019
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.
darova
darova el 25 de Abr. de 2019
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?
madhan ravi
madhan ravi el 26 de Abr. de 2019
+1

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Preguntada:

el 24 de Abr. de 2019

Comentada:

el 26 de Abr. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by