Giter VIP home page Giter VIP logo

Comments (5)

unicfdlab avatar unicfdlab commented on May 11, 2024

Hi, this code allows to limit Y displacement of the sphere.

Y_.first() - Position
Y_.second() - Velocity

You don't need to modify your RK2 solver if your object starts to move from point different to (0 0 0)

from trainingtracks.

Haider-BA avatar Haider-BA commented on May 11, 2024

Thank you. One thing more to clear: If the object start to move from an arbitrary position (i.e. Xc, Yc), not from (0 0 0), then how and what part to modify? Where Xc = 0.5, Yc = 0.5 or any value other than 0.

from trainingtracks.

unicfdlab avatar unicfdlab commented on May 11, 2024

Hi, sorry for the late reply.
If Xc = Yc = 0.5, then:

  1. Center of the object in your mesh must be in the poing (0.5; 0.5)
  2. Yold_.first() = 0.5 at startup

from trainingtracks.

Haider-BA avatar Haider-BA commented on May 11, 2024

Thank you for the reply.

Sorry, I forget to mention about my domain boundaries, they are [0,0] to [10,10]. Normally, the above is true when domain is extended in both positive and negative directions e.g [-1,-1] to [1,1]. In my case, the rest length for the spring (-kx) will be different that what I am confused with. What will be the "Yold_.first() or Ymid.first()" in the equation:

Ymid.second()= Yold_.second() + 0.5*dt*(-C_*Yold_.second() - K_*Yold_.first() + R_*yForce) / M_;
Y_.second()= Yold_.second() + dt*(-C_*Ymid.second() - K_*Ymid.first() + R_*yForce) / M_;

I have attached an illustrative image to clear my point and want to modify the equations according to the sketched situation.

sketch1

from trainingtracks.

unicfdlab avatar unicfdlab commented on May 11, 2024

Hi, you don't need to change equations. Equations describes numerical solution of some ODE from some initial position.
Just initialize your Yold_.first() with 5.0 in the class constructor or somewhere, where are you creating variable and reading data

from trainingtracks.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.