Hi, I am new to Mathematica and am trying to solve minimum time optimal control problem using NDSolve. Please see attached for my notebook. I have 4 ODEs and 4 boundary conditions. Final time (tf) in this case is also unknown and need to be calculated by another constraint (transversality condition for free final time):
1 + \[Lambda1][tf]*x2[tf] - \[Lambda2][tf]*Sign[\[Lambda2]][tf] == 0
I am not sure how to add this equation to NDSolve and solve the problem altogether to include tf? I am sure there is a better way to do it. I thought this problem was straightforward but I couldn't find solution online...so here I am asking for help. This problem can actually be solved by hand calculation but I want to learn how to solve it with Mathematica. Thank you so much for your help!
Attachments: