Student Support Forum: 'Minimum Distance between Two 3D Functions?' topicStudent Support Forum > General > "Minimum Distance between Two 3D Functions?"

 < Previous Comment Help | Reply To Comment | Reply To Topic
 Author Comment/Response Bill Simpson 10/02/12 9:08pm Please check this carefully to make certain that I have not introduced any scrape-n-paste errors in the process of doing this. In[1]:= r[t_] := Piecewise[{{{-1000, -1000, -1000}, t<0}, {{5*t, 0, 3*(1 + Cos[t])}, 0 <= t <= Pi}, {{5*Pi - 5*Sin[t], 5 + 5*Cos[t], 0}, Pi2.31536,t->18.2768}} Just because we place constraints on the variables in NMinimize does not seem to ensure that the variables will always satisfy those constraints. That can mean that one or both your functions can be undefined, and thus NMinimize fails, or that a minimum outside your conditions might confuse the process. So I augment your two functions to make certain they are defined for all possible values and that they return very large results that will never be a minimum when outside your original ranges. It might be nicer if these large results got linearly worse as we get farther outside the boundaries, but sometimes just large constants are enough. URL: ,

 Subject (listing for 'Minimum Distance between Two 3D Functions?') Author Date Posted Minimum Distance between Two 3D Functions? Ted Thizzle 09/19/12 6:25pm Re: Minimum Distance between Two 3D Functions? Bill Simpson 10/02/12 9:08pm
 < Previous Comment Help | Reply To Comment | Reply To Topic