Train length and etcs#11
Conversation
# Conflicts: # train.py
dkouzoup
left a comment
There was a problem hiding this comment.
Thanks a lot for the new MR. I left a couple of comments here and there. As this one is getting pretty big, I suggest that any new code apart from addressing the comments comes in a new branch on your side and eventually MR here.
| @@ -0,0 +1,552 @@ | |||
| from bisect import bisect_right | |||
There was a problem hiding this comment.
Amazing! I am not able to check the code for correctness so I suggest to add an appropriate unit test eventually. I would export the curves and parameters from the excel we have in a json file and compare them against your output.
|
|
||
| vel0 = (60/3.6)**2 | ||
| vel_avg = (self.points.index[-1]-self.points.index[0])/(terminalTime-initialTime) * 0.95 | ||
| vel0 = vel_avg*vel_avg |
There was a problem hiding this comment.
Let's add a test that runs all paper simulations and simply checks that solver converges. We might need to slightly adapt the scripts to output solver status. Maybe on a separate PR as this one is getting too big
| tuples = self.sampleClothoid(tuples, clothoidSamplingInterval) | ||
|
|
||
| self.curvatures = importTuples(tuples, 'Position [m]', ['Curvature [1/m]']) | ||
| self.curvatures["Curvature [1/m]"] = self.curvatures["Curvature [1/m]"].abs() |
There was a problem hiding this comment.
What's this for? I thought sign is used to defer direction of curve? I understand that force on the train is the same regardless of the direction but I would expect that this is handled in the OCP, or isn't it?
There was a problem hiding this comment.
Because curvature resistance is symmetric it makes it easier to just use the absolute curvature resistance especially for train-length dependent curvature resistance.
Otherwise if I have a short right turn and then a short left turn with the same radius and I take the average w.r.t. the train length, I might get 0 curvature resistance for this segment.
There was a problem hiding this comment.
Ok yes, that makes sense, I'm just wondering if we should directly modify the track object or instead the representation of the track inside the OCP, where the force calculation matters. My point is that if one day we want to plot the track in 2D, this abs here would affect the results. I'm also wondering whether we were taking this symmetry appropriately into account before (i.e., both turns result to same force)
No description provided.