MaplePrimes - Maple 2017 Posts and Questions
http://www.mapleprimes.com/products/Maple/Maple 2017
en-us2024 Maplesoft, A Division of Waterloo Maple Inc.Maplesoft Document SystemWed, 17 Apr 2024 09:49:48 GMTWed, 17 Apr 2024 09:49:48 GMTMaple 2017 Questions and Posts on MaplePrimeshttp://www.mapleprimes.com/images/mapleprimeswhite.jpgMaplePrimes - Maple 2017 Posts and Questions
http://www.mapleprimes.com/products/Maple/Maple 2017
Procedure + Plot
https://www.mapleprimes.com/questions/238116-Procedure--Plot?ref=Feed:MaplePrimes:Version Maple 2017
<p>Hi,</p>
<p>I am trying to generate a plot using a procedure. A dummy code is as follows:</p>
<p>***</p>
<p>fun := piecewise(x+y > 1, (x+y)^2, x-y);</p>
<p>temp_proc := proc(x, y)<br>
local out, ind:</p>
<p>ind := 9:</p>
<p>if x > y then ind := 1 else ind := 0 end if; </p>
<p>if <span style="background-color:#27ae60;">ind = 1</span> then out := eval(5*fun, {:-x=x, :-y=y}) else out := eval(-5*fun, {:-x=x, :-y=y}) end if:</p>
<p>return(out);<br>
end proc:</p>
<p>xt := 5: yt := 2:<br>
out1_fin := temp_proc(xt, yt);</p>
<p>plot(out1_fin, z=-2..3);<br>
</p>
<p>***</p>
<p>The issue is as follows:</p>
<p>1. I am getting an error message for the code above: "Error, (in temp_proc) cannot determine if this expression is true or false: 2 < z".</p>
<p>2. The entire procedure and the plot command work well for a fixed "z". However, it is not useful for me as I am looking for a plot for various values of z. </p>
<p>3. I hope I don't have to run the procedure by manually creating a list of z and then plotting the lists of z and out1_fin. </p>
<p>4. I am using the "ind" variable because it simplifies my actual code, which involves multiple conditions defining the function "fun" that I need to plot. </p>
<p>I would appreciate your input on how to resolve the issue. </p>
<p>Regards,</p>
<p>Omkar</p>
<p> </p>
<p>Hi,</p>
<p>I am trying to generate a plot using a procedure. A dummy code is as follows:</p>
<p>***</p>
<p>fun := piecewise(x+y > 1, (x+y)^2, x-y);</p>
<p>temp_proc := proc(x, y)<br />
local out, ind:</p>
<p>ind := 9:</p>
<p>if x > y then ind := 1 else ind := 0 end if; </p>
<p>if <span style="background-color:#27ae60;">ind = 1</span> then out := eval(5*fun, {:-x=x, :-y=y}) else out := eval(-5*fun, {:-x=x, :-y=y}) end if:</p>
<p>return(out);<br />
end proc:</p>
<p>xt := 5: yt := 2:<br />
out1_fin := temp_proc(xt, yt);</p>
<p>plot(out1_fin, z=-2..3);<br />
</p>
<p>***</p>
<p>The issue is as follows:</p>
<p>1. I am getting an error message for the code above: "Error, (in temp_proc) cannot determine if this expression is true or false: 2 < z".</p>
<p>2. The entire procedure and the plot command work well for a fixed "z". However, it is not useful for me as I am looking for a plot for various values of z. </p>
<p>3. I hope I don't have to run the procedure by manually creating a list of z and then plotting the lists of z and out1_fin. </p>
<p>4. I am using the "ind" variable because it simplifies my actual code, which involves multiple conditions defining the function "fun" that I need to plot. </p>
<p>I would appreciate your input on how to resolve the issue. </p>
<p>Regards,</p>
<p>Omkar</p>
<p> </p>
238116Wed, 03 Apr 2024 10:22:46 ZomkardpdomkardpdQuery regarding the output of a procedure
https://www.mapleprimes.com/questions/238113-Query-Regarding-The-Output-Of-A-Procedure?ref=Feed:MaplePrimes:Version Maple 2017
<p>Hi, <br>
I am struggling with the output of a procedure. A dummy code is as follows:</p>
<p>*****</p>
<p>fun := x^2+y^2;</p>
<p>temp_proc := proc(x, y)<br>
local out1, out2, out3:</p>
<p>if x > 0 then out1 := fun; out2 := 2*fun; out3 := k*fun;<br>
elif x <= 0 then out1 := fun; out2 := -2*fun; out3 := -k*fun;<br>
end if:</p>
<p>return(out1, out2, out3);<br>
end proc:</p>
<p>xt := -1: yt := 2:<br>
out1_fin := temp_proc(xt, yt)[1];<br>
out2_fin := temp_proc(xt, yt)[2];<br>
out3_fin := temp_proc(xt, yt)[3];</p>
<p><br>
*****</p>
<p>xt and yt are numerical input parameters. I expect to obtain "out1_fin" and "out2_fin" in numerical form and "out3_fin" in symbolic form. All three outputs should substitute xt and yt for x and y, respectively, wherever relevant. </p>
<p>However, currently, the output I am getting is not after substituting the values of xy and yt. The output is as follows:</p>
<p>*****</p>
<p>out1_fin := x^2+y^2</p>
<p>out2_fin := -2*x^2-2*y^2 </p>
<p>out3_fin := -k*(x^2+y^2)</p>
<p>*****</p>
<p>May I get some help in resolving the issue? </p>
<p>Also, would a procedure be a good idea for this task, or would a module be better? </p>
<p>I would appreciate any guidance in this regard. Thank you. </p>
<p>Regards,</p>
<p>Omkar</p>
<p>Hi, <br />
I am struggling with the output of a procedure. A dummy code is as follows:</p>
<p>*****</p>
<p>fun := x^2+y^2;</p>
<p>temp_proc := proc(x, y)<br />
local out1, out2, out3:</p>
<p>if x > 0 then out1 := fun; out2 := 2*fun; out3 := k*fun;<br />
elif x <= 0 then out1 := fun; out2 := -2*fun; out3 := -k*fun;<br />
end if:</p>
<p>return(out1, out2, out3);<br />
end proc:</p>
<p>xt := -1: yt := 2:<br />
out1_fin := temp_proc(xt, yt)[1];<br />
out2_fin := temp_proc(xt, yt)[2];<br />
out3_fin := temp_proc(xt, yt)[3];</p>
<p><br />
*****</p>
<p>xt and yt are numerical input parameters. I expect to obtain "out1_fin" and "out2_fin" in numerical form and "out3_fin" in symbolic form. All three outputs should substitute xt and yt for x and y, respectively, wherever relevant. </p>
<p>However, currently, the output I am getting is not after substituting the values of xy and yt. The output is as follows:</p>
<p>*****</p>
<p>out1_fin := x^2+y^2</p>
<p>out2_fin := -2*x^2-2*y^2 </p>
<p>out3_fin := -k*(x^2+y^2)</p>
<p>*****</p>
<p>May I get some help in resolving the issue? </p>
<p>Also, would a procedure be a good idea for this task, or would a module be better? </p>
<p>I would appreciate any guidance in this regard. Thank you. </p>
<p>Regards,</p>
<p>Omkar</p>
238113Tue, 02 Apr 2024 12:20:43 ZomkardpdomkardpdHow can Idraw Steiner Trees in Graph theory?
https://www.mapleprimes.com/questions/237464-How-Can-Idraw-Steiner-Trees-In-Graph-Theory?ref=Feed:MaplePrimes:Version Maple 2017
<p>How can I draw Steiner trees of hypercubes in graph theory? </p>
<p>How can I draw Steiner trees of hypercubes in graph theory? </p>
237464Sat, 02 Dec 2023 21:00:29 ZShaimaa MeerzahShaimaa Meerzahsolve system with variables then plot3d
https://www.mapleprimes.com/questions/237112-Solve-System-With-Variables-Then-Plot3d?ref=Feed:MaplePrimes:Version Maple 2017
<p>hi</p>
<p>I have a linear system with varibles trying to plot 3d the solutions x, y, z</p>
<p>here is my code: <a href="/view.aspx?sf=237112_question/linear_var.mw">linear_var.mw</a></p>
<p>please any comment might help.</p>
<p>*******************************</p>
<p>restart;</p>
<p>Omega:=10:N:=0.5:M:=sqrt(N(N+1)):</p>
<p>a11:=0.5*(1+2*N)+M*cos(phi):<br>
a12:=-0.5*((1+theta)^3+(1-theta)^3):a13:=-0.5*(N+M*cos(phi))*((1+theta)^3-(1-theta)^3): a21:=M*sin(phi): a22:=(-(1+2*N)+0.5*M*cos(phi))*((1+theta)^3+(1-theta)^3): a23:=-(Omega+0.5*((1+theta)^3-(1-theta)^3)*M*sin(phi)): a31:=0.25*((1+theta)^3-(1-theta)^3): a32:=Omega: a33:=-0.5-(N+0.25)*((1+theta)^3+(1-theta)^3): b1:=-0.5*a31: b2:=0: b3:=0.25+((1+theta)^3+(1-theta)^3)/8:</p>
<p>slove([a11*x+a12*y+a13*z=b1,a21*x+a22*y+a23*z=b2,a31*x+a32*y+a33*z=b3[,[x,y,z]);<br>
Error, unable to match delimiters<br>
Typesetting:-mambiguous(Typesetting:-mambiguous(slovelparlsqba11</p>
<p> sdotx + a12sdoty + a13sdotzequalsb1commaa21sdotx + a22sdoty + </p>
<p> a23sdotzequalsb2commaa31sdotx + a32sdoty + a33sdotzequalsb3lsqb</p>
<p> comma(xyz)rparsemi, </p>
<p> Typesetting:-merror("unable to match delimiters")))</p>
<p>plot3d(x, theta = .1 .. 5, phi = 0 .. 2*Pi, axes = boxed);<br>
plot3d(y, theta = .1 .. 5, phi = 0 .. 2*Pi, axes = boxed); plot3d(z, theta = .1 .. 5, phi = 0 .. 2*Pi, axes = boxed);</p>
<p>hi</p>
<p>I have a linear system with varibles trying to plot 3d the solutions x, y, z</p>
<p>here is my code: <a href="/view.aspx?sf=237112_question/linear_var.mw">linear_var.mw</a></p>
<p>please any comment might help.</p>
<p>*******************************</p>
<p>restart;</p>
<p>Omega:=10:N:=0.5:M:=sqrt(N(N+1)):</p>
<p>a11:=0.5*(1+2*N)+M*cos(phi):<br>
a12:=-0.5*((1+theta)^3+(1-theta)^3):a13:=-0.5*(N+M*cos(phi))*((1+theta)^3-(1-theta)^3): a21:=M*sin(phi): a22:=(-(1+2*N)+0.5*M*cos(phi))*((1+theta)^3+(1-theta)^3): a23:=-(Omega+0.5*((1+theta)^3-(1-theta)^3)*M*sin(phi)): a31:=0.25*((1+theta)^3-(1-theta)^3): a32:=Omega: a33:=-0.5-(N+0.25)*((1+theta)^3+(1-theta)^3): b1:=-0.5*a31: b2:=0: b3:=0.25+((1+theta)^3+(1-theta)^3)/8:</p>
<p>slove([a11*x+a12*y+a13*z=b1,a21*x+a22*y+a23*z=b2,a31*x+a32*y+a33*z=b3[,[x,y,z]);<br>
Error, unable to match delimiters<br>
Typesetting:-mambiguous(Typesetting:-mambiguous(slovelparlsqba11</p>
<p> sdotx + a12sdoty + a13sdotzequalsb1commaa21sdotx + a22sdoty + </p>
<p> a23sdotzequalsb2commaa31sdotx + a32sdoty + a33sdotzequalsb3lsqb</p>
<p> comma(xyz)rparsemi, </p>
<p> Typesetting:-merror("unable to match delimiters")))</p>
<p>plot3d(x, theta = .1 .. 5, phi = 0 .. 2*Pi, axes = boxed);<br>
plot3d(y, theta = .1 .. 5, phi = 0 .. 2*Pi, axes = boxed); plot3d(z, theta = .1 .. 5, phi = 0 .. 2*Pi, axes = boxed);</p>
237112Fri, 29 Sep 2023 21:03:06 Zadel-00adel-00How to solve a multivariate non-linear system of equations with algebraic coefficient in Maple.
https://www.mapleprimes.com/questions/237033-How-To-Solve-A-Multivariate-Nonlinear?ref=Feed:MaplePrimes:Version Maple 2017
<p>I have a guess about the set of the zeros of the following polynomial</p>
<p style="text-align: center;">y(1-x^{m+1}z)+(1-x^{n+1}z), (here m,n are positive integers and z is a primitive d-root of unity)</p>
<p>which are located on the complex 2-dimensional torus. The set of solutions is finite (I think the system is zero-dimensional). My goal is to verify my guess numerically using Maple for some small values of m and n and a fixed value of z. I think if (x,y) is a solution, then x is either a (n-m) root of unity or a (n-m) root of 1/z^2 (where n>m).</p>
<p>You can find my code for n=3 and m = 1 attached (I was not able to load the mw format so I put the zip version). I consider z to be a third root of unity but actually, I am interested in putting z= exp(2pi/3*i) and even the real third root z=1 is not interesting for me, but since the exponential representation led to an error, I changed it to z and mentioned that z^3=1. Still, it has an error and I would be grateful if you could let me know how I can correct this code. </p>
<p><a href="/view.aspx?sf=237033_question/Question.maple.zip">Question.maple.zip</a></p>
<p>I have a guess about the set of the zeros of the following polynomial</p>
<p style="text-align: center;">y(1-x^{m+1}z)+(1-x^{n+1}z), (here m,n are positive integers and z is a primitive d-root of unity)</p>
<p>which are located on the complex 2-dimensional torus. The set of solutions is finite (I think the system is zero-dimensional). My goal is to verify my guess numerically using Maple for some small values of m and n and a fixed value of z. I think if (x,y) is a solution, then x is either a (n-m) root of unity or a (n-m) root of 1/z^2 (where n>m).</p>
<p>You can find my code for n=3 and m = 1 attached (I was not able to load the mw format so I put the zip version). I consider z to be a third root of unity but actually, I am interested in putting z= exp(2pi/3*i) and even the real third root z=1 is not interesting for me, but since the exponential representation led to an error, I changed it to z and mentioned that z^3=1. Still, it has an error and I would be grateful if you could let me know how I can correct this code. </p>
<p><a href="/view.aspx?sf=237033_question/Question.maple.zip">Question.maple.zip</a></p>
237033Thu, 14 Sep 2023 16:13:43 Z2211714722117147remove frames arround legend in graph
https://www.mapleprimes.com/questions/236942-Remove-Frames-Arround-Legend-In-Graph-?ref=Feed:MaplePrimes:Version Maple 2017
<p>Is there a way to delete frames arround the legend in a plot?</p>
<p>Is there a way to delete frames arround the legend in a plot?</p>
236942Sat, 26 Aug 2023 06:20:48 Zmohamedbaadechemohamedbaadeche