Maple 2016 Questions and Posts

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

Friends in Maple

I have a Vehicle Routing Problem I wish to cast as a integer model. VRP is a kind of TSP and knapsack problem hybrid  I would be grateful if someone can finish it. answers included. This isn't homework BTW.

VRP_IP.mw

I use maple 12 on my dual core laptop and i plan to buy maple 2016 and an 8 core system to get advandage of multiple processors. 

Does maple 2016 functions get advandage of multiprocessor systems or it will be the same as having one processor?

Here is one that the students generated which caused confusion. 

a := 0.76;
eq1 := 2*cot(a*sqrt(2*E)) = (2*E-5.4)/(sqrt(E*(5.4-E));
solve(eq1, E)

And the results are: 0., 4.411954070, 2.423743792

The problem is with the second answer because it does not exist. If we plot the LHS and the RHS of eq1 vs E where E=0..5.4

plot([2*cot(0.76*sqrt(2*E)), (2*E-5.4)/sqrt(E*(5.4-E))], E=0..5.4, -3..3)

And it gets more interesting, if we calculate:

solve(evalf(eq1), E)

The answers are: 0., 2.423743793, 14.33807304+27.39159712*I

where the 3rd answer is again incorrect.

Finally, if a = 0.8 or larger, the incorrect answers disappear. 

Note - fsolve does handle this problem correctly. And despite my attempts to remind them to use fsolve, they see the solve command as the universal truth. Apparently this will be another teaching moment for next year.

So any thoughts about why this happens and why there is a difference in the outcomes between 0.76 and 0.8 for the value of a?

 

hi .how i can fsolve 8 equations, in which obtained from

for k from 2 to m do eq1[k_] end do

AND

for k from 2 to m do eq2[k_] end do  and so on........

And gain unknown functions as f3[2], f4[4],....

thanks?

fdm-maple.mw
 

 

 ############################Define some parameters

 

 
restart; Digits := 15; n := 1; m := 3; len := 1; h := len/m; nn := m+1
 ############################Define some equation

eq1[k_] := -3.0*h*(-f2[k]*f1[k-1]+f2[k]*f1[k+1]+f1[k]*(-f2[k+1]+f2[k-1]))*f4[k]^2+((-8.0*f1[k]+4.0*f1[k-1]+4.0*f1[k+1])*f3[k]+(-f1[k+1]+f1[k-1])*(-f3[k+1]+f3[k-1]))*f4[k]-f3[k]*(-f1[k+1]+f1[k-1])*(-f4[k+1]+f4[k-1]):

 

 

 

 

                                     ######################################  APPLY BOUNDARY CONDITIONS


f2[0] := f2[2];

1.0

(1)


``for k from 2 to m do eq1[k_] end do

-1.00000000000000*(-f1[2]*f2[3]+f1[3]*(-f2[4]+f2[2]))*f4[3]^2+((-8.0*f1[3]+4.0*f1[2])*f3[3]+f1[2]*(-f3[4]+f3[2]))*f4[3]-f3[3]*f1[2]*(-f4[4]+f4[2])

(2)

for k from 2 to m do eq2[k_] end do

(-4.16666666666667*f2[2]^2+(50.0000000000000*f2[3]+8.33333333333333*f2[4])*f2[2]-100.000000000000*f2[3]^2+50.0000000000000*f2[3]*f2[4]-4.16666666666667*f2[4]^2+1/27)*f4[3]^2+((f2[2]-1.*f2[4]-.5*f2[3])*f3[3]+(-50.*f3[2]+50.*f3[4])*f2[2]+(-50.*f3[2]+50.*f3[4])*f2[4]+(100.*f3[2]-100.*f3[4])*f2[3])*f4[3]+((50.*f4[2]-50.*f4[4])*f2[2]+(50.*f4[2]-50.0*f4[4])*f2[4]+(-100.0*f4[2]+100.*f4[4])*f2[3])*f3[3]

(3)

for k from 2 to m do eq3[k_] end do

-0.123456790123457e-1*f4[3]^3*f3[3]+((1/27)*(.5*f2[2]-.5*f2[4])*f3[3]-0.277777777777778e-1*f2[3]*f3[2]+0.277777777777778e-1*f2[3]*f3[4])*f4[3]^2+(-.222222222222222*f3[3]^2+((1/9)*f3[2]+(1/9)*f3[4]+4.*f2[3]^2+(-4.*f2[2]-4.*f2[4])*f2[3]+f2[2]^2+2.*f2[4]*f2[2]+f2[4]^2)*f3[3]+0.277777777777778e-1*f3[2]^2-0.555555555555556e-1*f3[2]*f3[4]+0.277777777777778e-1*f3[4]^2)*f4[3]+(1/9)*((-.25*f4[2]+.25*f4[4])*f3[2]+(.25*f4[2]-.25*f4[4])*f3[4])*f3[3]

(4)

for k from 2 to m do eq4[k_] end do

-0.493827160493827e-1*f4[3]^4-(1/27)*(-f2[4]+f2[2])*f4[3]^3+(.111111111111111*f2[3]*(f4[4]-f4[2])-.888888888888889*f3[3]+16.0*(f2[3]-.500000000000000*f2[2]-.500000000000000*f2[4])^2)*f4[3]^2+.444444444444444*((f3[3]+.250000000000000*f3[2]-.250000000000000*f3[4])*f4[2]+f4[4]*(f3[3]-.250000000000000*f3[2]+.250000000000000*f3[4]))*f4[3]-(1/9)*f3[3]*(f4[4]-f4[2])^2

(5)

``


 

Download fdm-maple.mw

 

hi.

how i can dsolve this differential equations?

thanks

ich.mw
 

restart; Digits := 50; dsol1 := dsolve({diff(F(eta), eta, eta, eta)+.5*H(eta)*((diff(F(eta), eta))^2+F(eta)*(diff(F(eta), eta, eta)))/G(eta)^2+2*(diff(G(eta), eta))*(diff(F(eta), eta, eta))/G(eta)-(diff(H(eta), eta))*(diff(F(eta), eta, eta))/H(eta) = 0, diff(G(eta), eta, eta)+H(eta)*((diff(F(eta), eta))*G(eta)+.5*F(eta)*(diff(eta, eta)))/G(eta)^2+2*(diff(G(eta), eta))^2/G(eta)-((diff(H(eta), eta))*(diff(H(eta), eta)))/H(eta)+(diff(F(eta), eta, eta))^2-(H(eta)/G(eta))^2 = 0, diff(H(eta), eta, eta)+(.5*1.3)*H(eta)*(5*(diff(F(eta), eta))*H(eta)+F(eta)*(diff(H(eta), eta)))/G(eta)^2+2*(diff(G(eta), eta))*(diff(H(eta), eta))/G(eta)-(diff(H(eta), eta))^2/H(eta)+(1.3*1.44)*H(eta)*(diff(F(eta), eta, eta))/G(eta)-(1.3*1.92)*(H(eta)/G(eta))^3 = 0, F(0) = 0, G(0) = 0, H(0) = 0, (D(F))(0) = 1, (D(F))(1) = 0, (D(G))(0) = 0, (D(H))(0) = 0}, 'maxmesh' = 900, numeric, output = listprocedure, method = bvp[middefer], abserr = 0.1e-2); fy := eval(F(eta), dsol1)

Error, invalid input: eval received dsol1, which is not valid for its 2nd argument, eqns

 

 

NULL


 

Download ich.mw

 

In the test package below I want the the Value of Clr to be "B" when the package is loaded. How do I achieve that?
 

restart

mylibdir := cat(kernelopts(homedir), kernelopts(dirsep), "maple", kernelopts(dirsep), "toolbox", kernelopts(dirsep), "personal", kernelopts(dirsep), "lib")

"C:\Users\Ronan.Ronan-PC\maple\toolbox\personal\lib"

(1)

``

libname := mylibdir, libname

"C:\Users\Ronan.Ronan-PC\maple\toolbox\personal\lib", "C:\Program Files\Maple 2016\lib", "C:\Users\Ronan.Ronan-PC\maple\toolbox\personal\lib"

(2)

``

``

``

"RTest:=module()  option package;  export  Sums;    global Clr;  Clr:=B;  Sums:=proc(p1,p2,c:=Clr)  if c=B or c=b  then    p1+p2  elif c=G or c=g then  p1-p2  elif c=R or c=r  then      if p2 =0 then "Not Valid"       else ( p1)/(p2)        end if  else "Error"  end if  end proc;    end module; "

_m655171968

(3)

``

savelib('RTest')

restart

``

with(RTest)

[Sums]

(4)

"At This point I want the value of Clr to be automaticially   B"

Sums(2, 3)

"Error"

(5)

RTest:-Sums(2, 3, b)

5

(6)

``

RTest:-Sums(2, 3, r)

2/3

(7)

RTest:-Sums(2, 3, g)

-1

(8)

Clr := g

g

(9)

RTest:-Sums(2, 3)

-1

(10)

RTest:-Sums(2, 3, b)

5

(11)

RTest:-Sums(2, 3)

-1

(12)

RTest:-Sums(2, 0, r)

"Not Valid"

(13)

``


 

Download Module_Test_global_Var.mw

When I was using Maple 2015, I can start Maple in Linux Mint Sarah, if Maple 2015 was installed in another Linux Distribution (that is, like Debian Jessie), as follows.   Suppose I have installed Maple 2015 in /home/programfiles/maple/maple2015, which is the location in Debian Jessie.  Start Linux Mint Sarah, then mount  the /home partition of Debian on the mountpoint /debian-home.  Now copy the file /debian-home/programfiles/maple/maple2015/bin/xmaple to be xmaple-a, and change the path in xmaple-a. Then copy the file  /debian-home/programfiles/maple/maple2015/bin/maple to be maple-a, and make some changes in maple-a. Then open a terminal, run the command  ./debian-home/programfiles/maple/maple2015/bin/xmaple-a. Thus I can start Maple2015 in Linux Mint Sarah, althought I have reinstalled Maple 2015 in Linux Mint.

But the problem occurs, when I upgrade to Maple 2016, together with Linux Mint from Sarah to Serena, because the method above does not work.  It gives information saying that the Host ID is wrong. But when I start Debian Jessie, I can start Maple 2016, and it works very well. So, what should I do to start Maple2016 in Linux Mint Serena, without installing Maple2016 in Mint, because I have installed in Debian?  

Let L = {a1, a2, ..., an} (or L = [a1, a2, ..., an]) with is homogeneous polynomial. How to create function createDegree() return elements of degree <= n from L.

Expamle. L = {a-2b, b^2, (a+c)^2}.

createDegree(L,1) return {a - 2b}.

createDegree(L,2) return {b^2, (a - 2b)^2, (a+c)^2, a - 2b}.

createDegree(L,3) return {b^2, (a - 2b)^2, (a - 2b)^3, (a+c)^2, (a - 2b)b^2, (a - 2b)(a+c)^2, a - 2b}.

Thanks you very much.

 

 

As you see above, when I want to evaluate the definite integral, Maple can not provide the desired result. Why does this happen? How can I do so that Maple can calculate this integral?

I want to plot the following equation

((1/2)*x*tan(log((1/5)*(2*(x^2+y^2)))) = y

I tried:

with(plots, implicitplot)

implicitplot((1/2)*x*tan(log((1/5)*(2*(x^2+y^2)))) = y, x = -5 .. 5, y =-5..5, numpoints = 1000, gridrefine = 6, color = red)

but result is strange... 

 

Hello, I have a function defined as

                                                   g :=  (x, y)->diff(u1(x, y), x, x)+diff(u2(x, y), x, y). 

I want to define another function as follows

                                                           f :=  (y) ->subs(x = 0, g(x, y)) ,

Now, when I want to calculate numerical values for the new function f(0), f(0.1), f(0.2),..... and so on. The following massage appear

Error, (in f) invalid input: diff received 0, which is not valid for its 2nd argument.

What is the problem here.

Amr
 

 

 

I have a system of ode's

restart:with(plots):
eq1:=((diff(f(x),x$3)))+f(x)*diff(f(x),x$2)-a*diff(f(x),x$1)^2=0;
eq2:=(diff(g(x),x$2))+b*f(x)*diff(g(x),x$1)=0;
bc1:=f(0)=0,D(f)(0)=1,D(f)(5)=0,g(0)=0.5,g(5)=0;

dsolve can solve it easily.

sol:=dsolve(subs(a=0.5,b=0.5,{bc1,eq1,eq2}), numeric):

Now I was to use the numerical data from the sol in the following expression

Expr:=a*f(x)+b*g'(x)+c*f'(x)*g(x) # at x=1:

to make a table of this form a  b  c  Expr, where a, b, c vary simultaneously between 0 and 1 by 0.2 producing data for Expr.

Any suggestions? 

 

Hi everyone!

I have a question: what is the simpliest way to generate colorbar for spectrogram?

Now I use "valuesplit" to assign dependece "z"-value from color.

My programm. My test file: "Signal.txt".

filtered_spectrogram.mw

Signal.txt

P.S. I use Maple 2016.

Hi all,

How to calculate this integral:

for k>0,m>0

Int(exp(-(1/2)*v/k)*v^3*exp((1/2)*v/m)*Ei(1, -(1000*I)*v+(1/2)*v/m), v = 0 .. infinity)

I'm  tried to take advantage of with(IntegrationTools) but I failed

and and I got a strange result ,like this:

Integral.mw

Can somebody execute this code on a powerful comp and report the result in MaplePrimes? That would be kind of her/him.


 

RealDomain:-solve(a^2+b^2+c^2+a*b+a*c+b*c-  (a+b-c)*sqrt(2*a*b+a*c+b*c)-(a+c-b)*sqrt(a*b+2*a*c+b*c)-(b+c-a)*sqrt(a*b+a*c+2*b*c));

Error, (in assuming) when calling '`resultant/modular2`'. Received: 'Maple was unable to allocate enough memory to complete this computation.  Please see ?alloc'

 

``


 

Download want_for_execution.mw

4 5 6 7 8 9 10 Last Page 6 of 28