- #106
Gh778
- 421
- 0
Here the code, I have verified with circular thread (cut if in the program), it's ok, with calculator : torque = pi*2*pi*(2*pi/10)*100000=1 240 251 Nm, and with program I found 1 240 412 Nm 5 digits for accuracy. Torque=v*(uLimit-u)/10.0*(sin(a)/cos(a))*pas*pas;
With square thread:
d=0rd/s => Torque=221 544 Nm
d=-0.5rd/s => Torque=223 990 Nm
There is a difference.
There always a torque with the square thread if the program is good, especially the torque.
The code:
#include <stdio.h>
#include <math.h>
#include <stdio.h>
int main(void)
{
double x=0.0,y=0.0,z=0.0; // each point of the circular thread, I use circular thread and after select only points which are on the square thread
double u=0.0,v=0.0; // u=altitude, v=radius
double a=0.0; // angle
double torque=0.0; // local torque
double torqueT=0.0; // total torque
double pas=0.001; // step for integration
double pi=3.1415927;
double vLimit=2.0*pi, uLimit=2.0*pi; // limit of integration, in meters
double c1=3.0, c2=4.0; // limit of the square thread in meters
double d=-0.5; // angle start for the helicoid
do
{
do
{
//calculation of each point of the helicoid
x=v*cos(u-d);
y=v*sin(u-d);
z=u;
// select only point for have the square thread
if( (x>c1 && x<c2 && y<c2 && y>-c2) || (x<-c1 && x>-c2 && y<c2 && y>-c2) || (y>c1 && y<c2 && x<c2 && x>-c2) || (y<-c1 && y>-c2 && x<c2 && x>-c2) )
{
a=atan(uLimit/2.0/pi/v);
torque=v*(uLimit-u)/10.0*(sin(a)/cos(a))*pas*pas; // Here the pressure is (uLimit-u)/10.0 in bar //// pas*pas = surface
torqueT+=torque;
/*
// print part result
printf("\nu=%f, v=%f", u,v);
printf("\nx=%f, y=%f, z=%f",x,y,z);
printf("\na=%f, couple=%f",a, torque);
printf("\nT=%f", torqueT);
system("pause");
*/
}
v+=pas; // increase step of integration
}while(v<vLimit);
v=0.0;
u+=pas; // increase step for integration
}while(u<uLimit);
printf("The total torque is: %f",torqueT*100000.0);
}
With square thread:
d=0rd/s => Torque=221 544 Nm
d=-0.5rd/s => Torque=223 990 Nm
There is a difference.
If you divided by 2 proof, you divided by 4 the torque because surface is half and pressure is half. With square thread, not exactly divided by 4 because the thread is square (depend of the start and end).I think if we make uLimit half, the torque becomes half too.
There always a torque with the square thread if the program is good, especially the torque.
The code:
#include <stdio.h>
#include <math.h>
#include <stdio.h>
int main(void)
{
double x=0.0,y=0.0,z=0.0; // each point of the circular thread, I use circular thread and after select only points which are on the square thread
double u=0.0,v=0.0; // u=altitude, v=radius
double a=0.0; // angle
double torque=0.0; // local torque
double torqueT=0.0; // total torque
double pas=0.001; // step for integration
double pi=3.1415927;
double vLimit=2.0*pi, uLimit=2.0*pi; // limit of integration, in meters
double c1=3.0, c2=4.0; // limit of the square thread in meters
double d=-0.5; // angle start for the helicoid
do
{
do
{
//calculation of each point of the helicoid
x=v*cos(u-d);
y=v*sin(u-d);
z=u;
// select only point for have the square thread
if( (x>c1 && x<c2 && y<c2 && y>-c2) || (x<-c1 && x>-c2 && y<c2 && y>-c2) || (y>c1 && y<c2 && x<c2 && x>-c2) || (y<-c1 && y>-c2 && x<c2 && x>-c2) )
{
a=atan(uLimit/2.0/pi/v);
torque=v*(uLimit-u)/10.0*(sin(a)/cos(a))*pas*pas; // Here the pressure is (uLimit-u)/10.0 in bar //// pas*pas = surface
torqueT+=torque;
/*
// print part result
printf("\nu=%f, v=%f", u,v);
printf("\nx=%f, y=%f, z=%f",x,y,z);
printf("\na=%f, couple=%f",a, torque);
printf("\nT=%f", torqueT);
system("pause");
*/
}
v+=pas; // increase step of integration
}while(v<vLimit);
v=0.0;
u+=pas; // increase step for integration
}while(u<uLimit);
printf("The total torque is: %f",torqueT*100000.0);
}
Last edited: