MaplePrimes Questions

Good day everyone,

I'm trying to convert a series solution back to its original function but its given me "Error, (in rsolve/linindex) invalid subscript selector".

Anyone with useful informations please.

Attached is the series below

 

theta := convert(a-(1/2)*beta*a^2*y^2+(1/12)*beta^2*a^3*y^4-(1/72)*beta^3*a^4*y^6+(1/504)*beta^4*a^5*y^8-(5/18144)*beta^5*a^6*y^10+(1/27216)*beta^6*a^7*y^12-(95/19813248)*beta^7*a^8*y^14+O(y^16), polynom);
     1       2  2   1      2  3  4   1      3  4  6
 a - - beta a  y  + -- beta  a  y  - -- beta  a  y 
     2              12               72            

       1      4  5  8     5       5  6  10     1       6  7  12
    + --- beta  a  y  - ----- beta  a  y   + ----- beta  a  y  
      504               18144                27216             

         95        7  8  14
    - -------- beta  a  y  
      19813248             
L := [seq(coeff(theta, y, n), n = 0 .. 14)];
  [        1       2     1      2  3       1      3  4     
  [a, 0, - - beta a , 0, -- beta  a , 0, - -- beta  a , 0, 
  [        2             12                72              

     1      4  5         5       5  6       1       6  7     
    --- beta  a , 0, - ----- beta  a , 0, ----- beta  a , 0, 
    504                18144              27216              

         95        7  8]
    - -------- beta  a ]
      19813248         ]
with(gfun);
rec := listtorec(L, u(n));
[ //      2     2  3         2     2  2          2     2  \        
[{ \2151 a  beta  n  - 1434 a  beta  n  - 30592 a  beta  n/ u(n) + 
[ \                                                                

  /             3                  2                  
  \2476 a beta n  - 137904 a beta n  + 207248 a beta n

                  \         
   + 424320 a beta/ u(n + 2)

     /         3           2                      \           
   + \-153660 n  - 322920 n  + 1803360 n + 2545920/ u(n + 4), 

                               1       2          \      ]
  u(0) = a, u(1) = 0, u(2) = - - beta a , u(3) = 0 }, ogf]
                               2                  /      ]

rsolve(rec[1], u);
      / //      2     2  3         2     2  2          2     2  \ 
rsolve|{ \2151 a  beta  n  - 1434 a  beta  n  - 30592 a  beta  n/ 
      \ \                                                         

         /             3                  2                  
  u(n) + \2476 a beta n  - 137904 a beta n  + 207248 a beta n

                  \         
   + 424320 a beta/ u(n + 2)

     /         3           2                      \           
   + \-153660 n  - 322920 n  + 1803360 n + 2545920/ u(n + 4), 

                               1       2          \    \
  u(0) = a, u(1) = 0, u(2) = - - beta a , u(3) = 0 }, u|
                               2                  /    /
sum(%*y^n, n = 0 .. infinity);
Error, (in rsolve/linindex) invalid subscript selector

thanx

 

My subsection have so many lines of codes, sometimes I want to disable one subsection, is there simple way to disable one subsection? it is tedious to set # at each lines of the subsection.

Is there any way to say maple dont open specified subsection during the running?

I have a system of ODE that I need to get an exact solution to. How can I do this using Maple? I tried doing it but error pops out.

Thanks

I saw a question earlier today regarding 3 particles in a gravitational field.  It has since disappeared. 

I see no rhyme or reason why it was deleted by someone, whoever did.  It was Math related and it was Maple related hence no reason for it's deletion.  This happened just before Mapleprimes and Maplesoft went offline for a couple of hours. 

Can someone explain?  Did anyone else see it?

I need help with these two questions. anything is helpful

I plotted number of functions y=y(x) with different parameter aa for given value of tau (see the code below) 

restart;
R0:=gamma+2*ln(2)+Re(Psi(1/2+(1+I)*tanh((1+I)*x)/((tau+0.25e-1*a)*y)))+ln(y);
tau := 9.975;
with(plots);
implicitplot({seq(R0, a = 1 .. 50)}, x = 0 .. 5, y = 0 .. 1, numpoints = 1000);

Thanks in a advance.

Hi, I try to create quizes in Maple 2016, but I don't know how to hide the Maple commands. Is it possible?


 

I'd like my students to see only 

 

when they access the quiz. Any help will be highly appreciated. Thank you.
 

I can not understand why the following statement works perfectly:
with (plots);
P1: = plot (f (x), x = xmin .. xmax, y = ymin .. ymax, color = "green");
P2: = plot (orddir, x = xmin .. xmax, y = ymin .. ymax, color = "blue");

Plots [display] (plottools [line] ([ascf, ymin], [ascf, 10]), color = red;
Plot ([5, y, y = 0 .. 10]);
P3: = implicit plot (x = ascf, x = xmin .. xmax, y = ymin .. ymax, color = red, linestyle = 3, thickness = 2);
P4: = plot (points, x = xmin .. xmax, y = ymin .. ymax, style = point, symbol = circle, symbolsize = 20, color = "black");
P5: = plot (h, x = xmin .. xmax, y = ymin .. ymax, color = "yellow");
Display ({p1, p2, p3, p4, p5}, axes = normal, scaling = unconstrained, title = "Parallel, vertice, focus, direction and axis of symmetry", gridlines = true);

While in the following
Points: = [F, V, A, B];
with (plots):
P1: = plot (f (x), x = xmin .. xmax, y = ymin .. ymax, color = "green");
P2: = plot (yd, x = xmin .. xmax, y = ymin .. ymax, color = "blue");
P3: = implicitplot (x = xv, x = xmin .. xmax, y = ymin .. ymax, color = red, linestyle = 3, thickness = 2);
P4: = plot (points, x = xmin .. xmax, y = ymin .. ymax, style = point, symbol = circle, symbolsize = 20, color = "black");

Do (% Plot0 = display ({p1, p2, p3, p4}, axes = normal, scaling = unconstrained, title = "Parallel, vertices, focus, direction and axis of symmetry", gridlines = true));

P4 does not print anything. In thanking you for the kind attention, I cordially greet you. Carmine Marotta ..


 

How is it possible that  GraphTheory:-TravelingSalesman  
is much slower than a simple brute-force solution?

 

restart;

n:=10:

A:=Matrix(n, (i,j)->`if`(i=j,0,n*(n-i)^4+2*j+(n-i)^2+j^3)):A[1,2]:=100*n^3:A;

Matrix([[0, 100000, 65724, 65763, 65826, 65919, 66048, 66219, 66438, 66711], [41027, 0, 41057, 41096, 41159, 41252, 41381, 41552, 41771, 42044], [24062, 24071, 0, 24131, 24194, 24287, 24416, 24587, 24806, 25079], [12999, 13008, 13029, 0, 13131, 13224, 13353, 13524, 13743, 14016], [6278, 6287, 6308, 6347, 0, 6503, 6632, 6803, 7022, 7295], [2579, 2588, 2609, 2648, 2711, 0, 2933, 3104, 3323, 3596], [822, 831, 852, 891, 954, 1047, 0, 1347, 1566, 1839], [167, 176, 197, 236, 299, 392, 521, 0, 911, 1184], [14, 23, 44, 83, 146, 239, 368, 539, 0, 1031], [3, 12, 33, 72, 135, 228, 357, 528, 747, 0]])

(1)

with(GraphTheory):

G:=Graph(A);

GRAPHLN(directed, weighted, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], Array(%id = 18446744074326770022), `GRAPHLN/table/1`, Matrix(%id = 18446744074326769782))

(2)

t:=time[real]():
TravelingSalesman(G);
'time'=time[real]()-t;

156750, [1, 3, 2, 4, 5, 6, 7, 8, 9, 10, 1]

 

time = 36.410

(3)

############### brute-force #############

t:=time[real]():
P:=Iterator:-Permute([seq(2..n)]):
cmin:=infinity: ord:=<"none">:
for  v in P do
  f:=add(A[v[k],v[k+1]],k=1..n-2) + A[1,v[1]]+A[v[n-1],1];
  if f<cmin then cmin:=f; ord:=copy(v) fi;
od:
cmin,[1, entries(ord,'nolist',indexorder),1];
'time'=time[real]()-t;

156750, [1, 3, 2, 4, 5, 6, 7, 8, 9, 10, 1]

 

time = 1.715

(4)

# And for n=11 I had to interrupt TravelingSalesman;
# brute-force still works for n=12.


 

Download TravelingSalesman-test.mw

Sometimes when one write a proc(), and later make changes, some of the earlier local variables could no longer used after the new edits.

In a small proc, it is easy to spot visually which ones are no longer needed and to remove them. But for a large proc() with many local variables, it is harder.

Does maple have a tool  to help one find which are the unused local declarations are not used? For example

foo:=proc(x)
local y,z:
x^2;
end proc;

I'd like maple to tell me that `y` and `z` are unused when I asked it to. (may be by highlighting or warning)

Mathematica has such a tool (and more) in its workbench editor which is very useful. does one need an external tool in Maple to do this?

Experts.

I'm trying to solve a Truck Routing Problem. I set in up in Maple and Excel, but I get a smaller minimum in the spreadsheet, than in Maple. Its like as if I havn't generated enough possible routes, even though i feel i've done an exaustive search. I realise the distance matrix violates the triangle inequality.  Any suggestions....

TRP_14x3.mw

A very big data was imported by me through

data := Import("http://fs3.fex.net/get/245716150875/11071260/data.txt");
"3.0994584798345
22.889020258043
....

26.082759642081
42.911810680717
6.4578968130322"



I need to convert it to Vector/Array. Now its type is "string":

whattype(data);
                             string

Here is my unsuccessful attempt:

convert(data,Vector);
Error, invalid input: `convert/Vector` expects its 1st argument, V, to be of type {Array, Matrix, Vector, array, sequential}, but received 3.0994584798345
22.889020258043
....

data.mw

Hey. Sorry if this is the wrong place to post, as I'm new here. Anyways, I'm trying to find the global maximum of a function, directly via Maple Commands, I've found that Maximize, does a good job to some degree, but when faced with "harder" constraints such as x^2+y^2=>1 it fails (or atleast I do :) ). I know that in WolframAlpha you can write that following as an example: 

Maximize[{(1-y^2)/(x^2), x^2 + y^2 <= 1,x>=1/2}, {x, y}]

http://www.wolframalpha.com/input/?i=Maximize%5B%7B(1-y%5E2)%2F(x%5E2),+x%5E2+%2B+y%5E2+%3C%3D+1,x%3E%3D1%2F2%7D,+%7Bx,+y%7D%5D

How would I do this in Maple? Any help would be more than welcome!! Thanks :D 

I am new user of Maple, couldn’t find solution for my problem in the last two days therefore I would like to turn to your community with my question. I am trying to replicate the calculations from a study to be sure about my understanding of the topic.

 

I cannot simplify the final equation even though the variables with their values are given. A screenshot and the file are attached, that might make easier to understand my problem.

I know what the solution should be. I cannot simplify/replace the values in the equation to get a simpler form; [(D0 - d1c - R)/ 2d1)]+c

 

Thank you if you have the time to help.

 

Joint_Pricing_Sol_.maple

i count the number among group
but when the list a large such as over 1000 records, the count will be over 30,000
use which denominator to find probability?
is there any functions in maple for this case?
 
with(LinearAlgebra):
correlationlist1 := [[1,2,3],[1,3,5]....]:
PAB := Matrix(50):
for ii from 1 to nops(correlationlist) do
 for jj from 1 to nops(correlationlist[ii]) do
  for kk from 1 to nops(correlationlist) do
   for qq from 1 to nops(correlationlist[kk]) do
    if ii <> kk then
     #print("scan=",correlationlist2[kk],"kk=",kk,"qq=",qq,"row=",correlationlist[ii][jj],"column=",correlationlist[kk][qq]):
     PAB[correlationlist[ii][jj],correlationlist[kk][qq]] := PAB[correlationlist[ii][jj],correlationlist[kk][qq]] + 1: # group to group relations
    end if:
   od:
  od:
 od:
od:
3 4 5 6 7 8 9 Last Page 5 of 1457