6 added 90 characters in body edited Jul 17 '14 at 13:03 george2079 36.3k11 gold badge3737 silver badges9494 bronze badges Here is a stab at what I think you are asking:  ti = 0; yi = 0; zi = -.75; zf = -.5; eps = .01; sol = {y[t], z[t]} /. First@FullSimplify[DSolve[{ y'[t] == 1/(2 zf) y[t] - u z[t], z'[t] == -1 + 1/zf z[t] + u y[t], y[ti] == yi, z[ti] == zi}, {y[t], z[t]}, t]]; target = {Sqrt[-2*(zf)*eps + eps^2], zf};  brute force discretize the solution and find the minimum distance to the target point (for such a highly nonlinear function this is much faster than NMinimise, and guarantees finding a global min, within the discretization approximation of course )  dis[u0_] := Min@Table[Norm[ (sol /. u -> u0) - target ] , {t, 0, 10, .05}];    note the range and increment on t here are important tuning parameters to play with.  Plot[dis[u], {u, -1, 1}] you come very close to your target point around 0.21. Armed with a good guess now we can use FindMinimum:  FindMinimum[Norm[sol - target], {u, .21 } , {t, 1}]  {3.23748*10^-9, {u -> 0.230625, t -> 1.62219}}  ParametricPlot[ Table[Chop[sol /. u -> u0 ], {u0, {.1, .230625, .3, 1, 5}}] , {t, 0, 10}, Epilog -> Point[target], PlotRange -> All, AspectRatio -> 1] Here is a stab at what I think you are asking:  ti = 0; yi = 0; zi = -.75; zf = -.5; eps = .01; sol = {y[t], z[t]} /. First@FullSimplify[DSolve[{ y'[t] == 1/(2 zf) y[t] - u z[t], z'[t] == -1 + 1/zf z[t] + u y[t], y[ti] == yi, z[ti] == zi}, {y[t], z[t]}, t]]; target = {Sqrt[-2*(zf)*eps + eps^2], zf};  brute force discretize the solution and find the minimum distance to the target point (for such a highly nonlinear function this is much faster than NMinimise, and guarantees finding a global min, within the discretization approximation of course )  dis[u0_] := Min@Table[Norm[ (sol /. u -> u0) - target ] , {t, 0, 10, .05}];   Plot[dis[u], {u, -1, 1}] you come very close to your target point around 0.21. Armed with a good guess now we can use FindMinimum:  FindMinimum[Norm[sol - target], {u, .21 } , {t, 1}]  {3.23748*10^-9, {u -> 0.230625, t -> 1.62219}}  ParametricPlot[ Table[Chop[sol /. u -> u0 ], {u0, {.1, .230625, .3, 1, 5}}] , {t, 0, 10}, Epilog -> Point[target], PlotRange -> All, AspectRatio -> 1] Here is a stab at what I think you are asking:  ti = 0; yi = 0; zi = -.75; zf = -.5; eps = .01; sol = {y[t], z[t]} /. First@FullSimplify[DSolve[{ y'[t] == 1/(2 zf) y[t] - u z[t], z'[t] == -1 + 1/zf z[t] + u y[t], y[ti] == yi, z[ti] == zi}, {y[t], z[t]}, t]]; target = {Sqrt[-2*(zf)*eps + eps^2], zf};  brute force discretize the solution and find the minimum distance to the target point (for such a highly nonlinear function this is much faster than NMinimise, and guarantees finding a global min, within the discretization approximation of course )  dis[u0_] := Min@Table[Norm[ (sol /. u -> u0) - target ] , {t, 0, 10, .05}];  note the range and increment on t here are important tuning parameters to play with.  Plot[dis[u], {u, -1, 1}] you come very close to your target point around 0.21. Armed with a good guess now we can use FindMinimum:  FindMinimum[Norm[sol - target], {u, .21 } , {t, 1}]  {3.23748*10^-9, {u -> 0.230625, t -> 1.62219}}  ParametricPlot[ Table[Chop[sol /. u -> u0 ], {u0, {.1, .230625, .3, 1, 5}}] , {t, 0, 10}, Epilog -> Point[target], PlotRange -> All, AspectRatio -> 1] 5 deleted 15 characters in body edited Jul 16 '14 at 21:39 george2079 36.3k11 gold badge3737 silver badges9494 bronze badges Here is a stab at what I think you are asking:  ti = 0; yi = 0; zi = -.75; zf = -.5; eps = .01; sol = {y[t], z[t]} /. First@FullSimplify[DSolve[{ y'[t] == 1/(2 zf) y[t] - u z[t], z'[t] == -1 + 1/zf z[t] + u y[t], y[ti] == yi, z[ti] == zi}, {y[t], z[t]}, t]]; target = {Sqrt[-2*(zf)*eps + eps^2], zf};  brute force discretize the solution and find the minimum distance to the target point (for such a highly nonlinear function this is much faster than NMinimise, and guarantees finding a global min, within the discretization approximation of course )  dis[u0_] := Min@Table[Norm[ (sol /. u -> u0) - target ] , {t, 0, 10, .05}]; Plot[dis[u], {u, -1, 1}] you come very close to your target point around 0.21. Armed with a good guess now we can use FindMinimum:  FindMinimum[Norm[(sol /. u -> u0)FindMinimum[Norm[sol - target ]target], {u0u, .21 } , {t, 1}]  {3.23748*10^-9, {u0u -> 0.230625, t -> 1.62219}}  ParametricPlot[ Table[Chop[sol /. u -> u0 ], {u0, {.1, .230625, .3, 1, 5}}] , {t, 0, 10}, Epilog -> Point[target], PlotRange -> All, AspectRatio -> 1] Here is a stab at what I think you are asking:  ti = 0; yi = 0; zi = -.75; zf = -.5; eps = .01; sol = {y[t], z[t]} /. First@FullSimplify[DSolve[{ y'[t] == 1/(2 zf) y[t] - u z[t], z'[t] == -1 + 1/zf z[t] + u y[t], y[ti] == yi, z[ti] == zi}, {y[t], z[t]}, t]]; target = {Sqrt[-2*(zf)*eps + eps^2], zf};  brute force discretize the solution and find the minimum distance to the target point (for such a highly nonlinear function this is much faster than NMinimise, and guarantees finding a global min, within the discretization approximation of course )  dis[u0_] := Min@Table[Norm[ (sol /. u -> u0) - target ] , {t, 0, 10, .05}]; Plot[dis[u], {u, -1, 1}] you come very close to your target point around 0.21. Armed with a good guess now we can use FindMinimum:  FindMinimum[Norm[(sol /. u -> u0) - target ], {u0, .21 } , {t, 1}]  {3.23748*10^-9, {u0 -> 0.230625, t -> 1.62219}}  ParametricPlot[ Table[Chop[sol /. u -> u0 ], {u0, {.1, .230625, .3, 1, 5}}] , {t, 0, 10}, Epilog -> Point[target], PlotRange -> All, AspectRatio -> 1] Here is a stab at what I think you are asking:  ti = 0; yi = 0; zi = -.75; zf = -.5; eps = .01; sol = {y[t], z[t]} /. First@FullSimplify[DSolve[{ y'[t] == 1/(2 zf) y[t] - u z[t], z'[t] == -1 + 1/zf z[t] + u y[t], y[ti] == yi, z[ti] == zi}, {y[t], z[t]}, t]]; target = {Sqrt[-2*(zf)*eps + eps^2], zf};  brute force discretize the solution and find the minimum distance to the target point (for such a highly nonlinear function this is much faster than NMinimise, and guarantees finding a global min, within the discretization approximation of course )  dis[u0_] := Min@Table[Norm[ (sol /. u -> u0) - target ] , {t, 0, 10, .05}]; Plot[dis[u], {u, -1, 1}] you come very close to your target point around 0.21. Armed with a good guess now we can use FindMinimum:  FindMinimum[Norm[sol - target], {u, .21 } , {t, 1}]  {3.23748*10^-9, {u -> 0.230625, t -> 1.62219}}  ParametricPlot[ Table[Chop[sol /. u -> u0 ], {u0, {.1, .230625, .3, 1, 5}}] , {t, 0, 10}, Epilog -> Point[target], PlotRange -> All, AspectRatio -> 1] 4 added 259 characters in body edited Jul 16 '14 at 21:28 george2079 36.3k11 gold badge3737 silver badges9494 bronze badges Here is a stab at what I think you are asking:  ti = 0; yi = 0; zi = -.75; zf = -.5; eps = .01; sol = {y[t], z[t]} /. First@FullSimplify[DSolve[{ y'[t] == 1/(2 zf) y[t] - u z[t], z'[t] == -1 + 1/zf z[t] + u y[t], y[ti] == yi, z[ti] == zi}, {y[t], z[t]}, t]]; target = {Sqrt[-2*(zf)*eps + eps^2], zf};  brute force discretize the solution and find the minimum distance to the target point (for such a highly nonlinear function this is much faster than NMinimise, and guarantees finding a global min, within the discretization approximation of course )  dis[u0_] := Min@Table[Norm[ (sol /. u -> u0) - target ] , {t, 0, 10, .05}]; Plot[dis[u], {u, -1, 1}] you come very close to your target point around 0.21. Armed with a good guess now we can use FindMinimum:  FindMinimum[Norm[(sol /. u -> u0) - target ], {u0, .21 } , {t, 1}]  {3.23748*10^-9, {u0 -> 0.230625, t -> 1.62219}}  ParametricPlot[ Table[Chop[sol /. u -> u0 ], {u0, {.1, .217230625, .3, 1, 5}}] , {t, 0, 10}, Epilog -> Point[target], PlotRange -> All, AspectRatio -> 1] Here is a stab at what I think you are asking:  ti = 0; yi = 0; zi = -.75; zf = -.5; eps = .01; sol = {y[t], z[t]} /. First@FullSimplify[DSolve[{ y'[t] == 1/(2 zf) y[t] - u z[t], z'[t] == -1 + 1/zf z[t] + u y[t], y[ti] == yi, z[ti] == zi}, {y[t], z[t]}, t]]; target = {Sqrt[-2*(zf)*eps + eps^2], zf};  brute force discretize the solution and find the minimum distance to the target point (for such a highly nonlinear function this is much faster than NMinimise, and guarantees finding a global min, within the discretization approximation of course )  dis[u0_] := Min@Table[Norm[ (sol /. u -> u0) - target ] , {t, 0, 10, .05}]; Plot[dis[u], {u, -1, 1}] you come very close to your target point around 0.21.  ParametricPlot[ Table[Chop[sol /. u -> u0 ], {u0, {.1, .217, .3, 1, 5}}] , {t, 0, 10}, Epilog -> Point[target], PlotRange -> All, AspectRatio -> 1] Here is a stab at what I think you are asking:  ti = 0; yi = 0; zi = -.75; zf = -.5; eps = .01; sol = {y[t], z[t]} /. First@FullSimplify[DSolve[{ y'[t] == 1/(2 zf) y[t] - u z[t], z'[t] == -1 + 1/zf z[t] + u y[t], y[ti] == yi, z[ti] == zi}, {y[t], z[t]}, t]]; target = {Sqrt[-2*(zf)*eps + eps^2], zf};  brute force discretize the solution and find the minimum distance to the target point (for such a highly nonlinear function this is much faster than NMinimise, and guarantees finding a global min, within the discretization approximation of course )  dis[u0_] := Min@Table[Norm[ (sol /. u -> u0) - target ] , {t, 0, 10, .05}]; Plot[dis[u], {u, -1, 1}] you come very close to your target point around 0.21. Armed with a good guess now we can use FindMinimum:  FindMinimum[Norm[(sol /. u -> u0) - target ], {u0, .21 } , {t, 1}]  {3.23748*10^-9, {u0 -> 0.230625, t -> 1.62219}}  ParametricPlot[ Table[Chop[sol /. u -> u0 ], {u0, {.1, .230625, .3, 1, 5}}] , {t, 0, 10}, Epilog -> Point[target], PlotRange -> All, AspectRatio -> 1] Post Undeleted by george2079 occurred Jul 16 '14 at 21:23 3 added 259 characters in body edited Jul 16 '14 at 21:23 george2079 36.3k11 gold badge3737 silver badges9494 bronze badges Post Deleted by george2079 occurred Jul 16 '14 at 21:13 2 added 6 characters in body edited Jul 16 '14 at 20:17 george2079 36.3k11 gold badge3737 silver badges9494 bronze badges 1 answered Jul 16 '14 at 20:11 george2079 36.3k11 gold badge3737 silver badges9494 bronze badges