mikafabricius / lumped_mass_spring_cable_model

MATLAB and Simulink simulation for underwater lumped-mass-spring cable model.
9 stars 0 forks source link

How to define initial values and boundary conditions? #3

Closed Vatista closed 4 months ago

Vatista commented 6 months ago

Hi, thank you very much for sharing the code! My project is to study the interference of cables on ROV on different currents, and I am a newbie to Matlab, so there are some questions about the use of the code:

  1. Does the definition of the initial state in line 52 require the velocity and position values to be defined for each note of the cable? If so, how to get the initial values?
  2. If I want to set the first note and the end node as the water surface fixed end and the ROV fixed end respectively, then how should I set the initial values of the two end points? I look forward to receiving your advise, thank you very much!
mikafabricius commented 6 months ago

You're welcome, I hope it helps!

  1. Yes it requires both of them to be initialized, it comes as a requirement from the numerical methods. You can decide on the initial values or if you have a specific case, you can load in those initial conditions. So as an example, let's say you have the cable laying in the water surface (20 m of cable) and you then have the ROV at the end of the 20 m. Then if you say 20 nodes, you would have the first node at (0,0,0), then the increment in the x-direction would be 1 m, so node 2 (1,0,0), node 3 (2,0,0), etc.. Most of the times you would initialize the velocities to (0,0,0) for all nodes. I have created a GUI in matlab for generating any initial cable position that you want, by dragging nodes around. Please let me know if this would help you, then I could release it as well.
  2. Again you could just start with the example I gave above. When fixating the position of nodes, remember to overwrite the next step position, found by the RK4. For inserting the ROV dynamics at the last nodes you can see an explanation here, if you have any trouble.

Feel free to ask again if I wasn't clear enough or didn't understand your questions. Best regards, Mika Fabricius

Vatista commented 6 months ago

Hi, sorry for replying late! Thank you very much, I already understand how to define the boundary conditions, but the length of the cable I am using is longer than the distance between the two end points, so I need to use a curve to define the initial shape of the cable, so if you can release the the GUI generating initial position, I would be really appreciate! Best wishes, and looking forward to your reply!

mikafabricius commented 5 months ago

No worries, I have just uploaded the GUI. It should be quite straight forward for using it, but for future reference: The GUI is used as a function in your MATLAB script, it takes two inputs, a vector with the final nodes position in [x,z] and an integer, n, representing the number of nodes. Here is an example: Umbilical_GUI([x,z],n). It should be noted that the GUI works in a standard 2D coordinate system, meaning that if you use conventional notation for underwater engineering, your z coordinate should be negative in the input of the GUI.

Let me know if there are any questions regarding the GUI. If you find the GUI troublesome to use all the time, you could run a simulation that you are happy with, save the cable node positions and then load them into your script, as initial conditions for the next simulations. I did that a lot when running larger cable simulations, especially during tows, since the cable dynamics are slow at settling.

Hope your find it useful, best regards, Mika Fabricius