Maple 2016 Questions and Posts

These are Posts and Questions associated with the product, Maple 2016

Hi

This question may have been asked before but I cannot find it!

I am currently have 3 lists:

L:= [1,3,5,2,3]

M:=[4,2,4,6,2]

R:= [5,3,2,1,4]

I would like to be able to come up with a way (I assume a procedure) where I can order L and M based on the numerical order of R. So in this case that would be:

R:=[1,2,3,4,5]

L:=[2,5,3,3,1]

M:=[6,4,2,2,4]

I hope this makes sense? Any help would be greatly appreciated!

 

The uploaded worksheet animates a cam formed of two Archimedean spirals as the cam rotates, creating vertical motion in a circular cam follower.

DirectSearch is used to locate the centre of the follower, however I experience two problems with this use.

First: DirectSearch places the follower centre sometimes above and sometimes below the cam surface, seemingly at random.

Second: seemingly at random, DirectSearch produces completely wrong values for the follower centre unless its SolveEquations command is executed with the initialpoint values stated in the worksheet. I arrived at these by extensive trial and error.

Why does the first problem occur and is there a way to code SolveEquations to avoid it?

Is there a writeup anywhere which can guide me to correct initialpoint values for a particular SolveEquations attempt?

Archimedian_spiral_cam_follower.mw

I can not integrate the following integral using maple 2016. Please guide me how to do it. I am a new user.


int(12.*x^3*c[2]+6.*x^2*c[1]+x^2*exp(x^3*c[2])*exp(x^2*c[1]), x = 0. .. 1.)

 

Why Maple does not simplify to 1

beta^(1/2)*(1+beta^(1/2))/(beta+beta^(1/2))

I have several functional equations in equally many unknown functions of at least two variables, plus parameters.  ("collect" works just for single equations, right?)

I know that for certain parameter ranges, all the functions involved will be quadratic, and I know some coefficients are zero.  That gives me some  coefficients to determine.  I want to

  1. specify the functional equations [done in a very primitive low-tech way in the attachment, using atomic variables rather than indices ... have I done correctly?!?] 
  2. get Maple to collect coefficients (the K's and the L's in the attachment; the variables are (y,z))
  3. get Maple to state an equation system these coefficients have to satisfy (these will unfortunately be coupled quadratics)
  4. get Maple to solve that equation system if possible, and if not: to tell me when (= for what parameter values, parameters being the "remaining letters" in the attachment) I have specified enough coefficients
  5. in case of a solution, get Maple to tell me which coefficients are real and positive (for those that are solution of quadratic eq's: whether a positive solution exists)

Phew. I am still a complete newbie. Edit: Attachment link: STcoeff2match.mw where the equations themselves are EQ0, EQ1 and EQ2 at the bottom. Copying and pasting them, they look like this (download STcoeff2pastedEQs.mw)

0 = -r__0*(K__011*y^2+K__022*z^2-K__012*(y-L__1)*(z-L__2)-K__01*(y-L__1)+K__02*(z-L__2))+(-2*K__011*y+m__1+K__012*(z-L__2)+K__01)*((2/3)*c__1*y-(4/3)*K__11*y+(2/3)*`K__12 `*(z-L__2)+(20/9)*K__011*y-(10/9)*K__012*(z-L__2)-(10/9)*K__01-(10/9)*m__1-(1/3)*c__2*z+(2/3)*K__22*z-(1/3)*`K__21 `*(y-L__1)-(16/9)*K__022*z+(8/9)*K__012*(y-L__1)-(8/9)*K__02+(8/9)*m__2)+(-2*K__022*z+m__2+K__012*(y-L__1)-K__02)*((2/3)*c__2*z-(4/3)*K__22*z+(2/3)*`K__21 `*(y-L__1)+(20/9)*K__022*z-(10/9)*K__012*(y-L__1)+(10/9)*K__02-(10/9)*m__2-(1/3)*c__1*y+(2/3)*K__11*y-(1/3)*`K__12 `*(z-L__2)-(16/9)*K__011*y+(8/9)*K__012*(z-L__2)+(8/9)*K__01+(8/9)*m__1)+(-(4/3)*K__011*y+(2/3)*K__022*z+(2/3)*K__012*(z-L__2)-(1/3)*K__012*(y-L__1)-(1/3)*m__2+(2/3)*m__1+(1/3)*K__02+(2/3)*K__01)^2+((2/3)*K__011*y-(4/3)*K__022*z-(1/3)*K__012*(z-L__2)+(2/3)*K__012*(y-L__1)+(2/3)*m__2-(1/3)*m__1-(2/3)*K__02-(1/3)*K__01)^2:

``

0 = -r__1*(K__11*y^2-`K__12 `*y*(z-L__2))+`K__12 `*y*((2/3)*c__2*z-(4/3)*K__22*z+(2/3)*`K__21 `*(y-L__1)+(20/9)*K__022*z-(10/9)*K__012*(y-L__1)+(10/9)*K__02-(10/9)*m__2-(1/3)*c__1*y+(2/3)*K__11*y-(1/3)*`K__12 `*(z-L__2)-(16/9)*K__011*y+(8/9)*K__012*(z-L__2)+(8/9)*K__01+(8/9)*m__1)+((2/3)*c__1*y-(4/3)*K__11*y+(2/3)*`K__12 `*(z-L__2)-(1/3)*c__2*z+(2/3)*K__22*z-(1/3)*`K__21 `*(y-L__1)-(10/9)*K__022*z+(5/9)*K__012*(y-L__1)-(5/9)*K__02+(5/9)*m__2+(8/9)*K__011*y-(4/9)*K__012*(z-L__2)-(4/9)*K__01-(4/9)*m__1)^2:

``

0 = -r__2*(K__22*z^2-`K__21 `*(y-L__1)*z)+`K__21 `*z*((2/3)*c__1*y-(4/3)*K__11*y+(2/3)*`K__12 `*(z-L__2)+(20/9)*K__011*y-(10/9)*K__012*(z-L__2)-(10/9)*K__01-(10/9)*m__1-(1/3)*c__2*z+(2/3)*K__22*z-(1/3)*`K__21 `*(y-L__1)-(16/9)*K__022*z+(8/9)*K__012*(y-L__1)-(8/9)*K__02+(8/9)*m__2)+((2/3)*c__2*z-(4/3)*K__22*z+(2/3)*`K__21 `*(y-L__1)-(1/3)*c__1*y+(2/3)*K__11*y-(1/3)*`K__12 `*(z-L__2)-(10/9)*K__011*y+(5/9)*K__012*(z-L__2)+(5/9)*K__01+(5/9)*m__1+(8/9)*K__022*z-(4/9)*K__012*(y-L__1)+(4/9)*K__02-(4/9)*m__2)^2:

``

 

 

 Dear All, If I have a square with lenght b and width 2a

.The question is how can I make Maple plot this square as points

.I want to define a function f(x_[i],y_[i]) for all sides.

Thanks

Hi, I'm a new user of Maple 2016.  I'm plotting a surface using plot3d and I'd like to add a line on the surface. You can see my unsatisfying attempt to do this below.  The line that shows in the third figure is basically what I want to show but I don't want the rest of the second surface at all, just the line visible on the first surface.  

thanks

Tom 
 

 

NULL

p1 := plot3d((1/2)*(-100+(1/2)*(200*Ab__T+200*Ag__T+20000)/sqrt(Ab__T^2-2*Ab__T*Ag__T+Ag__T^2+200*Ab__T+200*Ag__T+10000))/Ab__T, Ab__T = 1 .. 1000, Ag__T = 10 .. 1000, axis[1, 2] = [mode = log])

 

NULL

I next want to add a line along the "ridge" in the figure. I'll try using a proc

 

 

p2 := proc (Ab__T, Ag__T) if abs(Ab__T-Ag__T+100) < 10 then (1/2)*(-100+(1/2)*(200*Ab__T+200*Ag__T+20000)/sqrt(Ab__T^2-2*Ab__T*Ag__T+Ag__T^2+200*Ab__T+200*Ag__T+10000))/Ab__T else 0 end if end proc:

p3 := plot3d(p2, 1 .. 1000, 10 .. 1000, grid = [200, 200])

 

plots:-display(p1, p3)

 

``


 

Download surface_plot_question.mw
 

{{(1/2)*(-100+(1/2)*(200*Ab__T+200*Ag__T+20000)/(Ab__T^2-2*Ab__T*Ag__T+Ag__T^2+200*Ab__T+200*Ag__T+10000)^(1/2))/Ab__T}}

(1)

NULL

p1 := plot3d((1/2)*(-100+(1/2)*(200*Ab__T+200*Ag__T+20000)/sqrt(Ab__T^2-2*Ab__T*Ag__T+Ag__T^2+200*Ab__T+200*Ag__T+10000))/Ab__T, Ab__T = 1 .. 1000, Ag__T = 10 .. 1000, axis[1, 2] = [mode = log])

 

NULL

I next want to add a line along the "ridge" in the figure. I'll try using a proc

 

 

p2 := proc (Ab__T, Ag__T) if abs(Ab__T-Ag__T+100) < 10 then (1/2)*(-100+(1/2)*(200*Ab__T+200*Ag__T+20000)/sqrt(Ab__T^2-2*Ab__T*Ag__T+Ag__T^2+200*Ab__T+200*Ag__T+10000))/Ab__T else 0 end if end proc:

p3 := plot3d(p2, 1 .. 1000, 10 .. 1000, grid = [200, 200])

 

plots:-display(p1, p3)

 

``


 

Download surface_plot_question.mw

 

restart;
with(PDEtools);
assume(k::real, x::real, omega::real, t::real, theta::real, c::real);
tr0 := c*(t*upsilon+x) = xi;
tr1 := I*(k*x+omega*t+theta);
tr2 := phi(lhs(tr0))*exp(tr1);
PDE := proc (u) options operator, arrow; I*(diff(u, t))+diff(u, x, x)-I*sigma*u*(conjugate(u)*(diff(u, x))-u*(diff(conjugate(u), x))) end proc;
Eq1 := PDE(tr2);
Eq2 := simplify(convert(expand(subs(tr0, Eq1)), diff));

for_maple_prime.mw

restart;
with(PDEtools);
assume(k::real, x::real, omega::real, t::real, theta::real, c::real);
u := phi(c*(t*upsilon+x))*exp(I*(k*x+omega*t+theta));
PDE := proc (u) options operator, arrow; I*(diff(u, t))+diff(u, x, x)-I*sigma*u*(conjugate(u)*(diff(u, x))-u*conjugate(diff(u, x))) end proc;
Eq1 := PDE(u)

Hi everyone.

I am trying to build a package in Maple out of a bunch of procedures that I have. To create the procedures, I write them on a Vim editor, than copy and paste into the Maple worksheet to test. In this way, it works (I end the procedure with ; and then I see all the text in blue and I afterwords test it).

I then gathered these procedures to a module, option package, and I do the same: edit on Vim, copy paste it to Maple worksheet and press enter to see a blue message "module() ... end module" in blue, and then I start playing.

However, I decided to add some more procedures to the module that was working. I have a new procedure that works (meaning when I copy to the worksheet it gives the blue text and I can call normally), but when I copy the contents of this new procedure inside the package, with all the others, and I copy everything to the worksheet, the package now fails to work. It gives a message "Error," in pink, no more text, and that is it. Does this sort of error sound familiar to anyone? Thanks in Advance,

Marcelo

I wrote this simple set of instructions  (Maple 2015 and Maple 2016)

restart:
p := x -> sum('a__||k' * x^k, k=0..5):
p(x);    # returns a0+ a1x +  ... + a5x5

p(1);   # returns a0+ ... + a5

p(0);   # returns 0 ...  not a0


Probably so huge a mistake that I can't see it !?!?!?

Could you please help me to fit it ?

TIA

I have a problem with writing this equation in maple.

the equation is: 

I want to write this equation in maple, so I write it in this way:

for k from 1 to 7 do tau[k] := add*(d(k, j)*(diff(theta[j](t), t, t)), j = 1 .. 7)+add(add(c[i, j, k]*(diff(theta[i](t), t))*(diff(theta[j](t), t)), j = 1 .. 7), i = 1 .. 7)+phi[k] end do:

but I see this error: Error, index out of bounds 

I appriciate if you help me find the problem.

Good day. Please can someone kindly help to reduce the result of this code. Thank you and kind regards

restart:
s:=(sum(a[j]*x^j,j=0..3)+sum(a[j]*exp(-(j-3)*x),j=4..7)):
F:=diff(s,x):
p1:=simplify(eval(s,x=q))=y[n]:
p2:=simplify(eval(F,x=q))=f[n]:
p3:=simplify(eval(F,x=q+h/3))=f[n+1/3]:
p4:=simplify(eval(F,x=q+h))=f[n+1]:
p5:=simplify(eval(F,x=q+5*h/3))=f[n+5/3]:
p6:=simplify(eval(F,x=q+2*h))=f[n+2]:
p7:=simplify(eval(F,x=q+7*h/3))=f[n+7/3]:
p8:=simplify(eval(F,x=q+3*h))=f[n+3]:


vars:= seq(a[i],i=0..7):
Cc:=eval(<vars>, solve({p||(1..8)}, {vars})):
for i from 1 to 8 do
	a[i-1]:=Cc[i]:
end do:
Cf:=s:
L:=collect(simplify(simplify(expand(eval(Cf,x=q+3*h)),size)), [y[n],f[n],f[n+1/3],f[n+1],f[n+5/3],f[n+2],f[n+7/3],f[n+3]], factor):
length(L);
H := ee -> collect(numer(ee),[exp],h->simplify(simplify(h),size))/collect(denom(ee),[exp],h->simplify(simplify(h),size)):
M:=y[n+3]=(H@expand)(L);
length(M);

 

> S:=-1/2*((-30*sqrt(3)+81*I)^(2/3)+21+2*sqrt(3)*(-30*sqrt(3)+81*I)^(1/3)-6*(-30*sqrt(3)+81*I)^(1/3)+I*sqrt(3)*(-30*sqrt(3)+81*I)^(2/3)-21*I*sqrt(3))/(-30*sqrt(3)+81*I)^(1/3);

When I enter

simplify(S);

a not much simpler expression involving arctan is output
but when I enter

factor(S);

the expected simplification to the number

3

is output.

This is not a but report, just a report of curious behavior.

I am using Maple 2016 on a Windows 10 PC.

 

             

First 14 15 16 17 18 19 20 Last Page 16 of 60