Click here to Skip to main content
15,906,333 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: executing a member function in a separate thread Pin
Christian Graus17-Oct-06 7:21
protectorChristian Graus17-Oct-06 7:21 
QuestionHow to get pixel value using WinForm Pin
uusheikh15-Oct-06 21:12
uusheikh15-Oct-06 21:12 
AnswerRe: How to get pixel value using WinForm Pin
Christian Graus17-Oct-06 7:22
protectorChristian Graus17-Oct-06 7:22 
GeneralRe: How to get pixel value using WinForm Pin
uusheikh17-Oct-06 23:03
uusheikh17-Oct-06 23:03 
GeneralRe: How to get pixel value using WinForm Pin
uusheikh17-Oct-06 23:06
uusheikh17-Oct-06 23:06 
QuestionRUNGE-KUTTA ALGORITH FOR SECOND-ORDER ODE Pin
sahoong15-Oct-06 6:57
sahoong15-Oct-06 6:57 
AnswerRe: RUNGE-KUTTA ALGORITH FOR SECOND-ORDER ODE Pin
Christian Graus17-Oct-06 7:23
protectorChristian Graus17-Oct-06 7:23 
GeneralRe: RUNGE-KUTTA ALGORITH FOR SECOND-ORDER ODE Pin
sahoong18-Oct-06 3:47
sahoong18-Oct-06 3:47 
Dear Chris,

Million thanks for your response.

Unfortunately, I still cannot paste the equation. It was typed with Microsoft equation editor.

The codes that I have written so far is below:

// Simulation of the Dynamics of a 2-Link Pan-Tilt Robotic Manipulator
/* This programme calculates the Velocity, Acceleration and the angles of inclination
of the two links of the Spherical Pointing Motor, which is essentially a Two-Link Robotic
Manipulator*/


//#include <basis.h>
//#include <assert.h>
//#include <string.h>
//#include <iostream.h>
//#include <iomanip.h>
//#include <fstream.h>

// Precompiler Directives

#include <math.h>
#include <stdlib.h>


// Constants Declaration

#define n (int) 2
#define m1 (float) 0.05
#define m2 (float) 0.03
#define r1 (float) 0.04
#define r2 (float) 0.06
#define ra (float) 0.04
#define rb (float) 0.06
#define l (float) 0.05
#define d (float) 0.02
#define acc_due_gravity (float) 9.81

class AngVel1
{
public:
};

class AngAccln1
{
public:
};

class AngVel2
{
public:
};

class AngAccln2
{
public:
}

/*
n = Number of Links = 2
m1 = Mass of the First Link (The Annulus)
m2 = Mass of the Second Link
r1 = Inner Radius of Link 1 (The Annulus)
r2 = Outer Radius of Link 1 (The Annulus)
ra = Outer Radius of the Annulus
rb = Inner Radius of the Annulus
l = Half the Lenght of Link 1
d = Displacement from the Centre of Mass
g = Acceleration due to gravity = 9.81
t = time in seconds
*/


// Declaration of variables (Robot Parameters)

float t;




// Prototypes

float TorqueVal(float t);
double Runge_Kutta ();

double AngVel1 (double om1){

return om1;
}

double AngAccln1 (double t, double om1, double tetha1, double tetha2){
t = 0.1;
return (tau1 - 2*m2(r2*r2/4 -h2*h2/3 -d*d) * om1*om2*sintetha2*costetha2 - m2*g*d*costetha1*costetha2)/
om1*(m1(ra*ra + rb*rb)/4 + m1(h1*h1)/3 + m2((r2*r2)(1+sinsqtetha2)/4 + m2*h2*h2*cossqtetha2/3 + m2*d*d*cossqtetha2);
}

double AngVel2 (double om2){
return om2;
}

double AngAccln2 (double t, double om1, double om2, double tetha1, double tetha2){
t=0.4;
return (tau2 + (m2(r2*r2/4 -h2*h2/3 -d*d)*om1*om1*sintetha2*costetha2) - m2*g*d*sintetha1*sintetha2)/
om2*m2(r2*r2/4 + h2*h2/3 + d*d;

double RK(double y){
double k1,k2,k3,k4;
k1=h*fn(y);
k2=h*fn(y+(k1/2.0));
k3=h*fn(y+(k2/2.0));
k4=h*fn(y+k3);
return y+(k1/6.0)+(k2/3.0)+(k3/3.0)+(k4/6.0);
}

// The Main Routine

int main()
{



// Torque Function
float TorqueVal1(float t)
{
t = 0.1;
return t;

}

// Runge-Kutta Function

double RK(double y){
double k1,k2,k3,k4;
k1=h*fn(y);
k2=h*fn(y+(k1/2.0));
k3=h*fn(y+(k2/2.0));
k4=h*fn(y+k3);
return y+(k1/6.0)+(k2/3.0)+(k3/3.0)+(k4/6.0);
}

double RK(double l){
double v1,v2,v3,v4;
v1=h*fn(l);
v2=h*fn(l+(k1/2.0));
v3=h*fn(l+(k2/2.0));
v4=h*fn(l+k3);
return l+(v1/6.0)+(v2/3.0)+(v3/3.0)+(v4/6.0);
}




}





I was not using a class before and I just started packing the four equation into classes.

You could me to olaskg@yahoo.ie.

Thank you.


skg
QuestionWinodws Media Player Visualization Pin
ceejeeb14-Oct-06 6:37
ceejeeb14-Oct-06 6:37 
QuestionC++/CLI managed code calling incorrect methods on unmanaged C++ classes Pin
dhazen13-Oct-06 5:20
dhazen13-Oct-06 5:20 
AnswerRe: C++/CLI managed code calling incorrect methods on unmanaged C++ classes Pin
dhazen25-Oct-06 10:13
dhazen25-Oct-06 10:13 
Questionproblem with converting CString to int Pin
singersinger11-Oct-06 1:33
singersinger11-Oct-06 1:33 
AnswerRe: problem with converting CString to int [modified] Pin
Epi11-Oct-06 2:36
Epi11-Oct-06 2:36 
AnswerRe: problem with converting CString to int Pin
led mike11-Oct-06 4:43
led mike11-Oct-06 4:43 
AnswerRe: problem with converting CString to int Pin
tydok18-Oct-06 4:02
tydok18-Oct-06 4:02 
QuestionFrom CString to String^ Pin
Epi11-Oct-06 0:41
Epi11-Oct-06 0:41 
AnswerRe: From CString to String^ Pin
Nish Nishant11-Oct-06 4:08
sitebuilderNish Nishant11-Oct-06 4:08 
Questiontreeview with windows forms Pin
Epi10-Oct-06 2:12
Epi10-Oct-06 2:12 
AnswerRe: treeview with windows forms Pin
jhwurmbach10-Oct-06 2:35
jhwurmbach10-Oct-06 2:35 
GeneralRe: treeview with windows forms Pin
Epi10-Oct-06 3:27
Epi10-Oct-06 3:27 
QuestionInvoke a method on a windows form object Pin
bankai1239-Oct-06 21:08
bankai1239-Oct-06 21:08 
QuestionAvoiding "using namespace" Pin
zaccheus9-Oct-06 13:31
zaccheus9-Oct-06 13:31 
AnswerRe: Avoiding "using namespace" Pin
Michael Dunn9-Oct-06 15:13
sitebuilderMichael Dunn9-Oct-06 15:13 
GeneralRe: Avoiding "using namespace" Pin
George L. Jackson9-Oct-06 23:36
George L. Jackson9-Oct-06 23:36 
GeneralRe: Avoiding "using namespace" Pin
zaccheus10-Oct-06 7:59
zaccheus10-Oct-06 7:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.