Wolfram ResearchProductsPurchasingServices & ResourcesAbout UsOur Sites
Student Support Forum
-----
Student Support Forum: 'Out of range message' topicStudent Support Forum > General > "Out of range message"

Next Comment >Help | Reply To Topic | Post New Topic
Author Comment/Response
Bill
07/03/08 01:00am

Hi:

Question: What would be the Mathematica code to test Out[5], to verify that all 4 values, {s,t,u,v}, are between 0 and 1? What I want to do is to print a mesage stating that the parameters are within tolerance, or are not within tolerance. (If even one is out of the 0 to 1 range, I want to reject the entire group.)

In[1]:=

Clear[X,Y,s,t,u,v,dSq];
X[s_,t_]={0+s*2+t*0,0+s*0+t*3,4+s*(-1)+t*(-1)};
Y[u_,v_]={v*Sin[u]-2,v*Cos[u],-v^2-1};
dSq[s_,t_,u_,v_]=(X[s,t]-Y[u,v]).(X[s,t]-Y[u,v]);
soln=FindRoot[{D[dSq[s,t,u,v],s]==0,D[dSq[s,t,u,v],t]==0,D[dSq[s,t,u,v],u]==0,D[dSq[s,t,u,v],v]==0},{{s,1},{t,1},{u,1},{v,1}}];
Chop[%,10^-6]
{s,t,u,v}=Flatten[{s,t,u,v}/.soln];


Out[5]=

{s->0.210459,t->0.537982,u->0.982794,v->0.300463}


tia,

Bill

PS. I'm using Mathematica 6.0.1 with Windows XP on a PC.

URL: ,

Subject (listing for 'Out of range message')
Author Date Posted
Out of range message Bill 07/03/08 01:00am
Re: Out of range message yehuda ben-s... 07/05/08 08:45am
Re: Out of range message Bill 07/05/08 11:50pm
Next Comment >Help | Reply To Topic | Post New Topic





 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy