Question: What is the error in my arrow code?

I have recently received a doc from my friend in privete group in maple cloud, the table showed both eye(view) icon and download icon).When I downloaded and run, the document does not run (maple 2019). 

When I sign in maple cloud and see the doc (only view button is ahow), the same document works fine. What could be the error?

I attach  a document extract showing the errors (unable to delimt   .../  identifiers).

Can any one help us please?

Thanks. Ramki.
 

``

"Refraction Demonstration          restart:with(plots):  RefractionDemo:=proc(theta1, n2)  local theta2,ainput,ainside,aoutput,box,line1,line2,H,n2text,theta1text,theta2text;   if(theta1<0)or(theta1>Pi/(2.0001)) then return end if;   #theta1:=theta01*Pi180.;   theta2:=arcsin(1/(n2)*sin(theta1));   ainput:=arrow(?&ndash;cos(theta1),&ndash;sin(theta1)?,?cos(theta1),sin(theta1)?,color="Red"):   ainside:=arrow(?0,0?,?1,tan(theta2)?,color="DarkBlue",width=[0.05,relative=false]):   aoutput:=arrow(?1,tan(theta2)?,?cos(theta1),sin(theta1)?,color="Red"):   line1:=plot(0,x=&ndash;1..0,thickness=4,color=black);   line2:=plot(tan(theta2),x=1..2,thickness=4,color=black);   H:=1.8:   box:=plottools:&ndash;rectangle([0,&ndash;H],[1,H],color="LightBlue"):   n2text:=textplot([0.5,1.5,sprintf("n_2=%1.3 g",n2)]);   theta1text:=textplot([&ndash;0.5,0.4,sprintf("theta_1=%4.3 g",theta1)]);   theta2text:=textplot([0.5,&ndash;0.4,sprintf("theta_2=%4.3 g",theta2)]);   display([ainput,ainside,aoutput,box,line1,line2,n2text,theta1text,theta2text],scaling=constrained,view=[&ndash;1..2,&ndash;1..H]);   endproc:        Light enters from the air into a medium at an angle of theta1 relative to the normal. It is refracted to an angle of theta2and travels through the medium, returning back to the air.      You can vary two parameters:       theta1the angle of incidence       n2the index of refraction of the medium*(assuming the index of refraction of the air is essentially 1.0).     To do: Let it execute and start manipulating the sliders.     >Explore(RefractionDemo(theta1,n2),parameters=[theta1=0..Pi2.0015,n2=1..3.]);6""

Error, unable to delimit strings/identifiers

"Refraction Demonstration          restart:with(plots):  RefractionDemo:=proc(theta1, n2)  local theta2,ainput,ainside,aoutput,box,line1,line2,H,n2text,theta1text,theta2text;   if(theta1<0)or(theta1>Pi/2.0001) then return end if;   #theta1:=theta01*Pi180.;   theta2:=arcsin(1/n2*sin(theta1));   ainput:=arrow(&acirc;ï¿&frac12;&uml;&ndash;cos(theta1),&ndash;sin(theta1)&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;cos(theta1),sin(theta1)&acirc;ï¿&frac12;&copy;,color="Red"):   ainside:=arrow(&acirc;ï¿&frac12;&uml;0,0&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;1,tan(theta2)&acirc;ï¿&frac12;&copy;,color="DarkBlue",width=[0.05,relative=false]):   aoutput:=arrow(&acirc;ï¿&frac12;&uml;1,tan(theta2)&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;cos(theta1),sin(theta1)&acirc;ï¿&frac12;&copy;,color="Red"):   line1:=plot(0,x=&ndash;1..0,thickness=4,color=black);   line2:=plot(tan(theta2),x=1..2,thickness=4,color=black);   H:=1.8:   box:=plottools:&ndash;rectangle([0,&ndash;H],[1,H],color="LightBlue"):   n2text:=textplot([0.5,1.5,sprintf("n_2=%1.3 g",n2)]);   theta1text:=textplot([&ndash;0.5,0.4,sprintf("theta_1=%4.3 g",theta1)]);   theta2text:=textplot([0.5,&ndash;0.4,sprintf("theta_2=%4.3 g",theta2)]);   display([ainput,ainside,aoutput,box,line1,line2,n2text,theta1text,theta2text],scaling=constrained,view=[&ndash;1..2,&ndash;1..H]);   endproc:        Light enters from the air into a medium at an angle of theta1 relative to the normal. It is refracted to an angle of theta2and travels through the medium, returning back to the air.      You can vary two parameters:       theta1the angle of incidence       n2the index of refraction of the medium*(assuming the index of refraction of the air is essentially 1.0).     To do: Let it execute and start manipulating the sliders.     >Explore(RefractionDemo(theta1,n2),parameters=[theta1=0..Pi2.0015,n2=1..3.]);"

 

``

``

``

``Dear Prof.

The following code seems not copying properly (my communication error be allowed please)

 

"ainput:=arrow(?&"

Error, unable to delimit strings/identifiers

"ainput:=arrow(&acirc;ï¿&frac12;&uml;&ndash;cos(theta1),&ndash;sin(theta1)&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;cos(theta1),sin(theta1)&acirc;ï¿&frac12;&copy;,color="Red"):ainside:=arrow(&acirc;ï¿&frac12;&uml;0,0&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;1,tan(theta2)&acirc;ï¿&frac12;&copy;,color="DarkBlue",width=[0.05,relative=false]):aoutput:=arrow(&acirc;ï¿&frac12;&uml;1,tan(theta2)&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;cos(theta1),sin(theta1)&acirc;ï¿&frac12;&copy;,color="Red"):"

 

``

``

"I checked by typing separately. It works as below."

``

``

a1 := arrow([-cos(theta1), -sin(theta1)], color = "LightBlue")

 

``ainput := arrow([-1, 0], color = "Red")

 

"But the copied from your code does not work."

"ainput:=arrow([-1, 0],color= "`Red"`)"

Error, unable to delimit strings/identifiers

"ainput:=arrow([-1, 0],color= "`Red"`)"

 

``


 

Download forScotgould_Error_arrow.mw

Please Wait...