08-09-2016, 02:50 PM
(This post was last modified: 08-09-2016, 06:16 PM by adriansnetlis.)

I have started the creation process. As a first step I'll only write the maths. After that me and Only a Petr will work on implementing it in Rigs of Rods core. Before that I'm writing it in my well-known environment - Blender - using Python. The mathematical part progress ir pretty well. I'll do pefrormance tests, but note that Python is slower than C++ and thus the results in my current environment will be slower than the final results in Rigs of Rods. Also note that this is just the early wip and there are still lots of features to be done.

The video:

I'll keep working on it as much as I can. Any feedback accepted

I came across one more question that I wanna ask to community. I need your opinions in order to decide which is better solution.

Current system is based of SI units(mass = kg, stiffness = N/m, damping = N/m/s).

However, you can note an interesting case. Let's study 2 examples:

1)Object consists of 100 kg heavy nodes.

Nodes are connected by springs with 10 000 N/m stiffness and 1 000 N/m/s damping.

2)Object consists of 1 kg heavy nodes.

Nodes are connected by springs with 1 000 N/m stiffness and 10 N/m/s damping.

Now let's study both of cases.

In case 1 the springs have got bigger stiffness than in case 2. However, guess in which case the object acts stiffer? Lemme tell for you - in 2nd case. At first moment you may think that it doesn't make sense, but note that the force that springs exert on nodes is equal to stiffness multiplied by compression, however, the acceleration is equal to force divided by mass. And thus the acceleration is lower for 1st case. And this means it acts less stiff and is softer(less rigid) than 2nd object.

There is different system for springs which isn't based on SI units, but is way more intuitive(mass = kg, stiffness = omega 0, damping = zeta).

In this system:

omega 0 = sqrt(k / m)

And so we can get k out of it:

k = omega 0 ^ 2 * mass

And:

zeta = c / (2 * sqrt(k * m))

Ans so we can get the c out of it:

c = 2 * sqrt(k*m) * zeta

How does this work?

User can define any number as omega 0 and we get stiffness out of it depending on mass. And this means that no matter what mass you have, the stiffness will match it. We could also use omega^2 and thus we wouldn't need the square conversion. This would still work correctly and be a bit more simple as it'd be linear.

In terms of damping this makes all extra easy. The zeta is the damping coefficient which works in the very comfortable system where:

zeta = 0 - non-damped

zeta < 1 - underdamped

zeta = 1 - critically damped

zeta > 1 - overdamped

This is very intuitive and easy to use. A big problem often is that people know that stiffness must be tweaked depending on mass, but they forget about the damping relation(which must be tweaked depending on stiffness and on mass. This system, however, does it automaticly and thus user only defines how the damping acts(either it's springy, soft, or clay-like and how much of each it is).

What I suggest is implementing this converter and allowing user to choose between SI units and this frequency and coefficient based system. The second system allows to define a material(e.g. steel, leather) and apply it's properties(stiffness and damping) on all springs, no matter what mass their supported nodes has.

What do you think about this?

And a new video report.

What's changed?

+Added substepping

+Added material system(full override only yet)

+Added intuitive non-SI system

*Some tweaks and code cleanup.

The video:

I'll keep working on it as much as I can. Any feedback accepted

I came across one more question that I wanna ask to community. I need your opinions in order to decide which is better solution.

Current system is based of SI units(mass = kg, stiffness = N/m, damping = N/m/s).

However, you can note an interesting case. Let's study 2 examples:

1)Object consists of 100 kg heavy nodes.

Nodes are connected by springs with 10 000 N/m stiffness and 1 000 N/m/s damping.

2)Object consists of 1 kg heavy nodes.

Nodes are connected by springs with 1 000 N/m stiffness and 10 N/m/s damping.

Now let's study both of cases.

In case 1 the springs have got bigger stiffness than in case 2. However, guess in which case the object acts stiffer? Lemme tell for you - in 2nd case. At first moment you may think that it doesn't make sense, but note that the force that springs exert on nodes is equal to stiffness multiplied by compression, however, the acceleration is equal to force divided by mass. And thus the acceleration is lower for 1st case. And this means it acts less stiff and is softer(less rigid) than 2nd object.

There is different system for springs which isn't based on SI units, but is way more intuitive(mass = kg, stiffness = omega 0, damping = zeta).

In this system:

omega 0 = sqrt(k / m)

And so we can get k out of it:

k = omega 0 ^ 2 * mass

And:

zeta = c / (2 * sqrt(k * m))

Ans so we can get the c out of it:

c = 2 * sqrt(k*m) * zeta

How does this work?

User can define any number as omega 0 and we get stiffness out of it depending on mass. And this means that no matter what mass you have, the stiffness will match it. We could also use omega^2 and thus we wouldn't need the square conversion. This would still work correctly and be a bit more simple as it'd be linear.

In terms of damping this makes all extra easy. The zeta is the damping coefficient which works in the very comfortable system where:

zeta = 0 - non-damped

zeta < 1 - underdamped

zeta = 1 - critically damped

zeta > 1 - overdamped

This is very intuitive and easy to use. A big problem often is that people know that stiffness must be tweaked depending on mass, but they forget about the damping relation(which must be tweaked depending on stiffness and on mass. This system, however, does it automaticly and thus user only defines how the damping acts(either it's springy, soft, or clay-like and how much of each it is).

What I suggest is implementing this converter and allowing user to choose between SI units and this frequency and coefficient based system. The second system allows to define a material(e.g. steel, leather) and apply it's properties(stiffness and damping) on all springs, no matter what mass their supported nodes has.

What do you think about this?

And a new video report.

What's changed?

+Added substepping

+Added material system(full override only yet)

+Added intuitive non-SI system

*Some tweaks and code cleanup.

Game developer; Like cars; Use Blender 3D a lot; Making a racing game; Want to make Rigs of Rods content

Project 'Next Sim'

Oh, yeah - I'm also a great PENGUIN!!!

Project 'Next Sim'

Oh, yeah - I'm also a great PENGUIN!!!