simulation testing for cosserat rods

6
Testing for Cosserat Rods Zhan Wang 30 November 2012 Contents 1 Characterization of stiffness[wiki stiffEquation] 2 2 Some Notes 2 3 Oscillating Ring 2 4 Pearl Chain CVT Setting 3 4.1 Results of θ method .................................... 3 4.2 Results of SSC ....................................... 4 4.3 Comparison of RCM and Cosserat ............................ 5 4.3.1 Different Parameters Setting ........................... 5 4.3.2 Integrator for the RCM .............................. 5 4.3.3 Elastic ........................................ 5 4.3.4 Results ....................................... 5 4.3.5 Performance Analysis ............................... 5 1

Upload: zhan-wang

Post on 11-Aug-2015

177 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Simulation Testing for Cosserat Rods

Testing for Cosserat Rods

Zhan Wang

30 November 2012

Contents

1 Characterization of stiffness[wiki stiffEquation] 2

2 Some Notes 2

3 Oscillating Ring 2

4 Pearl Chain CVT Setting 34.1 Results of θ method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34.2 Results of SSC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44.3 Comparison of RCM and Cosserat . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

4.3.1 Different Parameters Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . 54.3.2 Integrator for the RCM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54.3.3 Elastic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54.3.4 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54.3.5 Performance Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1

Page 2: Simulation Testing for Cosserat Rods

1 Characterization of stiffness[wiki stiffEquation]

A linear constant coefficient system is stiff if all of its eigenvalues have negative realpart and the stiffness ratio is large. Stiffness occurs when stability requirements, ratherthan those of accuracy, constrain the step length. Stiffness occurs when somecomponents of the solution decay much more rapidly than others.[2]

As the stiffness ratio is determined by the property of the system, which includes the deformationflexible rod and movement of rigid body. The stiffness cannot eliminate by improving the formula.The only way is to use A-stable Integrator.

2 Some Notes

• LSODE: adaptive timestep size, to look for angular and position

• h can not larger than 1e-6, otherwise collapse for all solver? theta method?? see the newsimulation result.

• trapezoidal method (θ = 0.5) does not have perfect stability: it does damp all decayingcomponents, but rapidly decaying components are damped only very mildly.

• There are no explicit A-stable and linear multistep methods. The implicit ones have order ofconvergence at most 2.

• The trapezoidal rule has the smallest error constant amongst the A-stable linear multistepmethods of order 2.

3 Oscillating Ring

The following simulation results are based on nine layer model.

• In the following simulation, ∆R = 0.1R, actually ∆R ≈ 1e-3 ∼ 1e-4 R in general.

• For the SSC: setMaxOrder(4,1), 4 means choose the order 4, which is the maximum, 1 meansmethod 1 which is embedded method (compare maxOrder maxOrder+1); proceed withmaxOrder (recommended).

• TimeSteppingIntegrator: if the number of elements is small, and time step size is extremelysmall, it will not crash during certain simulation time.

Table 1: Crash TimeTimestep elements number=20 elements number=8

1e-6 0.00001s 0.00002s1e-7 0.00001s -1e-8 0.001s 0.01229s1e-9 0.0089 -

• LSODE: does not improve so much,

– crash time(elements number=20): 0.001s

2

Page 3: Simulation Testing for Cosserat Rods

– crash time(elements number=10): 0.002s

– crash time(elements number=8): 0.19818s (the step size is during 1e-8 ∼ 1e-9)

– use the option set.stiff does not helps so much, crash at 0.009s(N=20) 0.1469s(N=8)

• SSC: when N=20, it does not improve so much. It crash as soon as it reach the minimumtime step size, which is 5.96046e-08s. So during simulation, as soon as we see it reach tehminimu time setp size, we should stop.

The simulation result in the table is based on ∆R = 0.01R .

Table 2: Stability Test

Model TimeStepping LSODE SSC RADAU5 Theta

one layer Y(1e-7) Y(1e-7) Y Y Ynine layer N(1e-9) N N Y Y

If using one layer model to calculate the area inertial moment I, all these method converge. Ifusing nine layer model, RADAU5 and integrator work.

4 Pearl Chain CVT Setting

I1 also have to be divided by pow(Nr, 2) as it is also consist of two separate part.

Table 3: Stability Test

I TimeStepping LSODE SSC RADAU5 Theta

I0 = I1 + I2 N N lack of Memory - YI0 = 0.32 ∗ (2wr) ∗ hr3 N N lack of Memory - Y

For the area inertial moment I2, one layer model and nine layer model are corresponding to twoextreme cases. The system will have the biggest stiffness ratio if the nine layer model is chosen.If the nine layer cannot be solved by the θ method, then we should improve this value by

• choose some value between the the one layer model and nine layer model, use bisection tofind the critical point

• experiment data

• use ANSYS to simulate to get the value if the friction coefficient is known.

• analysis how much does the inertial moment effects the simulation result which we need.

In the testing, for nine layer model, θ method is even faster than the SSC method, as the SSCmethod is reaching the minimum time step size,which is 5.96046e-08s or 2.98023e-08(with newsetting).

4.1 Results of θ method

It seems that the area inertial moment I2 calculated by the nine layer model is too small so thatthe ring seems to be too elastic. The correct value should between the values calculated by thenine layer model and the one layer model. (I2one/I2nine = 81) we try to use bisection to find the

3

Page 4: Simulation Testing for Cosserat Rods

critical point, testing different value of I2 which is between I2one and I2nine:I2 = K ∗ I2nine,K = 1, 21, 41, 61, 81.

After testing, we decide to choose the I2 = 41 ∗ I2nine temporarily.

Table 4: Stability Test of θ Method: I0 = I1 + I2, θ = 0.5

I 1e-5 5e-5 1e-4 5e-4 1e-3

I2 = 1 ∗ I2nineI2 = 21 ∗ I2nineI2 = 41 ∗ I2nine Y(0.19805) 0.0752 0.0767 0.075I2 = 61 ∗ I2nineI2 = 81 ∗ I2nine

Table 5: Stability Test of θ Method: I0 = I1 + I2, θ = 0.878

I 1e-5 5e-5 1e-4 5e-4 1e-3

I2 = 1 ∗ I2nine Y(may stop around 0.19s) -I2 = 21 ∗ I2nine Y(may stop around 0.19s) 0.0753sI2 = 41 ∗ I2nine Y(0.1997s) 0.0745s 0.0756s 0.082sI2 = 61 ∗ I2nine Y(may stop around 0.19s) 0.0753sI2 = 81 ∗ I2nine Y(may stop around 0.19s) 0.0737s 0.0745s 0.0835s

Table 6: Stability Test of θ Method: I0 = I1 + I2, θ = 1

I 1e-5 5e-5 1e-4 5e-4 1e-3())

I2 = 1 ∗ I2nineI2 = 21 ∗ I2nineI2 = 41 ∗ I2nine Y(0.19325s) 0.0737s 0.0658sI2 = 61 ∗ I2nine 0.092sI2 = 81 ∗ I2nine

Comparing the results of simulation by setting θ = 1,θ = 0.5, it shows a slightly difference afterabout 0.095s. But the overall tends of them are the same. When θ = 0.5, the solution is moreoscillating locally than that of when θ = 1. But when θ = 0.5, the global error is controlled betterthan that when θ = 1. So it diverges later. It indicates that a more smaller stepsize is needed formore accurate solution and longer simulation.

4.2 Results of SSC

The SSC is very slow for solving Pearl Chain CVT Setting as it always reach the minimum stepsizewhich is too small. And the memory consumption is quite high, causing the simulation stops atabout 0.05s. So the SSC is infeasible for this simulation.

4

Page 5: Simulation Testing for Cosserat Rods

Table 7: Stability Test of SSC Method: I0 = I1 + I2, SSC, SSCNewSetting

I SSC(setMaxOrder(2,1)) SSC(setMaxOrder(1,0), setFlagErrorTest(2,false),SetGapControl(true, 1))

I2 = 1 ∗ I2nine N N(0.01383s, lack of Memory)I2 = 21 ∗ I2nineI2 = 41 ∗ I2nine Y N(0.058s, lack of Memory)I2 = 61 ∗ I2nineI2 = 81 ∗ I2nine Y

Table 8: Stability Test of SSC Method: I0 = 0.32 ∗ (2wr) ∗ hr3

I SSC(setMaxOrder(2,1)) SSC(setMaxOrder(1,0), setFlagErrorTest(2,false),SetGapControl(true, 1))

I2 = 1 ∗ I2nineI2 = 21 ∗ I2nineI2 = 41 ∗ I2nineI2 = 61 ∗ I2nineI2 = 81 ∗ I2nine

4.3 Comparison of RCM and Cosserat

4.3.1 Different Parameters Setting

4.3.2 Integrator for the RCM

TimeSteppingIntegrator: 1e-6(Converge) 5e-5(No convergence) 1e-5(No convergence)

4.3.3 Elastic

When I2 = 1 ∗ I2nine, the results of both methods show a high elastic property.

4.3.4 Results

The overall tend of results of these two methods are the same. The results of RCM model isoscillating locally. A new simulation with time step size equals 1e− 9 is executed to check whetherthe oscillating is generated as the timestep size is large(1e− 6). The simulation is still running.

4.3.5 Performance Analysis

1. Preparation: compile the code with debugging info (the -g option) and with optimization(-O3) turned on.

2. To start a profile run for a program, execute: ”valgrind –tool=callgrind –cache-sim=yes–branch-sim=yes ./main”, an output file named callgrind.out.pid will be generated.

3. Visualization the output file: use the tool caller Kcachegrind. Usage: ”kcachegrindcachegrind.out.pid”

The meaning of some abbreviation in Kcachegrind:

Ir : Instruction Read

5

Page 6: Simulation Testing for Cosserat Rods

Table 9: Different Parameters Setting of RCM and Cosserat

I RCM CosseratI1 t-n t-bI2 t-b t-nI0

setCurlRadius R1: t-n R2: t-b R1: t-b R2: t-n

Incl. : Inclusive Cost. Cost attributes for functions regarding some event type, including all calledfunctions.

Self : Exclusive Cost. Cost attributes for functions regarding some event type, only of thefunction itself.

Table 10: Performance of Cosseratinitialize updateStateDependentVariables updateJacobians updateG

TimeStepping 17.27 - 19.74 34.2SSC 5.92 5.06 15.67 54.37theta - 29.52 45.66 -

Table 11: Performance of RCMinitialize updateJacobians updateG updateg updateh

TimeStepping 35.8 9.03 22.43 11.91 9.63SSC 19.33 6.67 33.04 10.08 7.01

6