Re: Rigid Body dynamics and solution methods



Just to sum up what I really have done... It seems like this could be an advantage for me and you.


Definitions:
G : Constraints
dG : Derivative's of the constraints
ddG : Double derivative of the constraints
m : mass-vector
q : coordinates
v : velocities
V : potential
dV : derivative of the potential (vector)
F :
T : both represent forces - see calculation below


Now I do the following calculations:

Calculate M:

unsigned int Msize = dG.size1(); // Number of constraints
ublas::matrix<double> M(Msize, Msize);

for (unsigned int alpha = 0; alpha < Msize; ++alpha) {
for (unsigned int beta = 0; beta < Msize; ++beta) {
double temp = 0;
for (unsigned int j = 0; j < N; ++j) {
temp += pow(m(j),-1) * dG(alpha,j) * dG(beta,j);
}
M(alpha, beta) = temp;
}
}



Calculate - F - T

unsigned int N = m.size();
unsigned int Msize = dG.size1(); // number of constraints

ublas::vector<double> F(Msize);
ublas::vector<double> T(Msize);

// Calculate F
for (unsigned int alpha = 0; alpha < Msize; ++alpha) {
double temp = 0;
for (unsigned int j = 0; j < N; ++j) {
temp -= pow(m(j),-1) * dG(alpha,j) * dV(j);
}
F(alpha) = temp;
}

// Calculate T
for (unsigned int alpha = 0; alpha < Msize; ++alpha) {
double temp = 0;
for (unsigned int j = 0; j < N; ++j) {
for (unsigned int k = 0; k < N; ++k) {
temp += ddG[alpha](j,k) * v(j) * v(k);
}
}

T(alpha) = temp;
}

return (- F - T);


Now I solve the systems of equations:

M * mu = - F - T

to find the constraint force multipliers and next calculate the accelerations :

ublas::vector<double> accel = -dV + prod(trans(dG), mu);
for (unsigned int i = 0; i < m.size(); ++i) {
accel(i) = accel(i)/m(i);
}

now it should be possible to use a method for solving the equations of motion!


Is this a bad method?
.



Relevant Pages

  • Re: Temp table creation
    ... Assuming that you NEED the temp table and want to create the constraints ... INSERT #temp_table1 SELECT table1.* FROM table1 ... > any way to create a temp table with table1 structure without the data then ...
    (microsoft.public.sqlserver.programming)
  • Re: Howto on SHAKE/RATTLE
    ... G: Constraints ... mass-vector (mass matrix - diagonal matrix) ... (mu is the constraint force multipliers, which can be solved by a linear set of equations) ... M= temp; ...
    (sci.math.num-analysis)
  • Re: Temp table creation
    ... We need the default constraint because after we populate the data in the ... temp table our application working on the temp table inserts new rows to the ... > Why are you adding default constraints to a temp table? ... >> the temp table using the alter table command. ...
    (microsoft.public.sqlserver.programming)
  • RE: Help with ALTER TABLE ADD COLUMN
    ... then remove constraints, ... insert your data from temp tables. ... > {column A int ... > how can I add a column B (say nvarchar for example) as the second one, ...
    (microsoft.public.sqlserver.programming)
  • Re: How to have project plan update after changing a task date
    ... My next suspect is constraints. ... rbenash wrote: ... Check Tools/Options.../Calculation tab that Calculation is set to ... to not automatically update. ...
    (microsoft.public.project)

Loading