MaplePrimes Questions

Fivebyfive_crossword.mwsFivebyfive_crossword.txt

  I am trying to solve a 5x5 crossword  puzzle, where one must find 5 across clues, and 5 down clues - all in a 5x5 square grid.  I have done a dictionary search for all the possibilities of the ten clues.  (For brevity this is not in the attached program.)  These possible solutions have been put as lists.  The attached Maple 7 program attempts to solve the crossword by a series of nested for loops, checking if the intersection of across and down clue letters match.  In this the use of nops is made, as the number of possible words for each clue varies.  I appreciate why the program fails, but am at a loss for a "work around", and fear a complete restart may be needed. 

   I attach two files of the program.  The Fivebyfive_crossword.mws Maple 7 file includes a graphic grid of the crossword, with asterisks (*)  for unknown letters.  The corresponding .txt file probably will not have that.  Sadly, Maple doesn't allow the upload of .rtf files.  Further documentation is in the program.

   Any comments, help would be most appreciated.

Hello,

      I've run into a strange problem with pdsolve. I'm attempting to solve a small PDE system. It seems pdsolve is quite capable of handling it, as it will occasionally return a valid answer. However, equally often, it returns a NULL result. And this is without changing anything else in the code: consecutive runs randomly produce a valid or NULL result.

      The only possible explanation I have is that, since this is a part of a larger code (~2k lines), perhaps something is going on with memory management? This is being run on a server (24 cores, 50GB RAM), so the total memory usage never rises above 0.5%. The cpu usage does hover around 100%-105% of a single core, but I doubt that's a problem. I've tried increasing stacklimit, processlimit, and cacheclearlimit, but it didn't seem to help.

      So, my question is, what sort of debugging or testing can I try? Are there any standard "tricks" to use here?

Thanks!

 

restart; Digits := 7; r := 2.5; Q := proc (n) options operator, arrow; int(simplify(1/(x*r^2*cos(x-y)+z*r^2*sin(z-y))^n, symbolic), y = 0 .. Pi) end proc; HH := eval(Q(5))

int(0.1048576e-3/(x^5*cos(x-1.*y)^5-5.*x^4*cos(x-1.*y)^4*z*sin(-1.*z+y)+10.*x^3*cos(x-1.*y)^3*z^2-10.*x^3*cos(x-1.*y)^3*z^2*cos(-1.*z+y)^2-10.*x^2*cos(x-1.*y)^2*z^3*sin(-1.*z+y)+10.*x^2*cos(x-1.*y)^2*z^3*sin(-1.*z+y)*cos(-1.*z+y)^2+5.*x*cos(x-1.*y)*z^4-10.*x*cos(x-1.*y)*z^4*cos(-1.*z+y)^2+5.*x*cos(x-1.*y)*z^4*cos(-1.*z+y)^4-1.*z^5*sin(-1.*z+y)+2.*z^5*sin(-1.*z+y)*cos(-1.*z+y)^2-1.*z^5*sin(-1.*z+y)*cos(-1.*z+y)^4), y = 0 .. Pi)

(1)

``


 

Download integral_unknown.mw

 

Can any one help to find the value of sigma(r,z) and theta(r,z) from the differential equations analytically, 

ODEs:= <
      diff(theta(r),r$2) = -(1/r)*diff(theta(r),r) - diff(sigma(r),r)*diff(theta(r),r)-diff(theta(r),r)^2,  
   diff(sigma(r),r$2) = -(1/r)*diff(sigma(r),r) -diff(theta(r),r$2)-(1/r)*diff(theta(r),r)>;
boundary conditions

'diff((theta),r)=0','diff((sigma),r)=0'; # at r=0
and theta=0, sigma=0; #at r=h(z) 

Dear all

I want to solve a set of parametric inequalities with constraints but it takes too much time to processing. do you know any faster solution? 
thanks in advance

I need to plot this system of differential equations but I don't know how.. Can anyone help?

S_(n+1)(t)=S_n(t)-int_0^t[d/dw S_n(w)- mu*N+beta*S_n(w)*J_n(w)+mu*S_n(w)] dw

E_(n+1)(t)=E_n(t)-int_0^t[d/dw E_n(w) - beta*S_n(w)*J_n(w)+mu*E_n(w)+sigma*E_n(w)]dw

J_(n+1)(t)=J_n(t)-int_0^t[d/dw J_n(w)- sigma*E_n(w)+mu*J_n(w)+gamma1*J_n(w)] dw

R_(n+1)(t)=R_n(t)-int_0^t[d/dw R_n(w)-gamma1*J_n(w)+mu*R_n(w)] dw

 

with initial value

beta=0.00001

mu=0.02

sigma=45.6

gamma1=73

S(0)=12500000

E(0)=50000

J(0)=30000

R(0)=37420000

S_0(t)=S(0) and the same with E_(0). J_(0), and R_(0). And n is the n-th approximation. 

I have problem with the diff and sum inside the integral..

 

I downloaded alglib from 

http://algo.inria.fr/libraries/obsolete-releases.html

Downloaded the .mla and the .hdb files. Put them in current directory where my worksheet .mw is.

Opened the .mw and typed

restart;
libname := currentdir(), libname;
_algolibcontent();

Content of algolib (version 14.0), as of October 2010:

+ encyclopedia.            [Written by Stéphanie Petit, with contributions by Bruno Salvy and Michèle Soria.]
+ gdev.                [Written by Bruno Salvy.]
+ gfun (version 3.53).        [Maintained and extended by Bruno Salvy, with contributions by Ludovic Meunier, Marc Mezzarobba, Marni Mishna, and Eithne Murray, original version by Bruno Salvy and Paul Zimmermann.]
+ Holonomy (version 3.4).    [Written by Frédéric Chyzak.]
+ MAD (version 1.445).        [Written by Ludovic Meunier.]
+ Mgfun (version 4.1).        [Written by Frédéric Chyzak, with contributions by Shaoshi Chen, Cyril Germa, Lucien Pech, and Ziming Li.]
+ MultiSeries.            [Written by Bruno Salvy.]
+ regexpcount (version 1.5).    [Written by Pierre Nicodème.]
 

Ok. Now how to obtain help? I can call one of its functions, like this

MADLaTeX:-latex(1/2);

    \frac{1}{2}

 

But I do not know how to find help on MADLaTeX:-latex since ?MADLaTeX does nothing and ?MADLaTeX:-latex does nothing. 

How to obtain the help pages for this package? I looked online and do not see anything. I do not know what to do with the .hdb file that I downloaded. I am using Maple 2018 and it does not seem to support .hdb files anyway. 

Does I need to go through all the conversion steps described in

https://www.maplesoft.com/support/help/Maple/view.aspx?path=HelpTools%2fMigrate

just to see help on one function? 

I just need to find how to call is Latex function and if it has any options. Any one knows an online page that have these on it?

How can I check six numbers: a, b, c, d, e, f are length six sides of a tetrahedron?

I am working with sequences and sometimes need to calculate the sum of prime factors (with multiplicity) of a number n. Example, n=12, answer = 2+2+3 = 7.

Any suggestions?

thanks

David. 

i need to plot this equation but can't find a way to do so. Can anyone help?

beta parameter and initial value of S(k), E(k) is known, but i have problems at the sum and (k+1)..

Hello!

I would like animate a function with multiple variables. At the moment my code in maple is:

 

plots[animate]( plot, [A*sin(B*x), x=0..10], A=0..2, B=0..2 );

 

I would like it to increase in amplitude when I run the A animation, and increase in frequency when I run the B animation. I want them to both be in the same graph , say have A=0.5 while B=0.5. then I could run the B animation with the amplitude fixed.

It would also be great to run them both at the same time.

Can someone help me?

-Thanks!!!

 

P.S: I'd eventually like to manipulate "implicitplot3d" with multple variables being animated at the same time.

hallo everyone, I'm working on a project for the Uni, and I'm facing the flowing problem.

I have Test-Matrix [3*12] called Testna it contains random nummbers( random because i wantend test the loop, the real matrix is much complexer ).

Testna := RandomMatrix(3, 12)

and I have a Vektor called Z

> Z:=Vector[row](5, {(1) = z, (2) = z-2, (3) = z-4, (4) = z-6, (5) = z-8})

>k:=4

Z and K are paramter previously in the worksheet

and I want to create a Matrix CC[3*3] using a nested loop so that the cofficient of CC(i,j) are as following

so for i =1 , j=1 and n from 1 to k=4  I wanted to have

CC(1,1):= Testna(1,1)*(Z(1,1)-Z(1,2))  +  Testna(1,4)*(Z(1,2)-Z(1,3) +Testna(1,7)*(Z(1,3)-Z(1,4))  +  Testna(1,10)*(Z(1,4)-Z(1,5)

so for i =1 , j=2 and n from 1 to k=4  I wanted to have

CC(1,2):= Testna(1,2)*(Z(1,1)-Z(1,2))  +  Testna(1,5)*(Z(1,2)-Z(1,3) +Testna(1,8)*(Z(1,3)-Z(1,4))  +  Testna(1,11)*(Z(1,4)-Z(1,5)

so for i =1 , j=3 and n from 1 to k=4  I wanted to have

CC(1,3):= Testna(1,3)*(Z(1,1)-Z(1,2))  +  Testna(1,6)*(Z(1,2)-Z(1,3) +Testna(1,9)*(Z(1,3)-Z(1,4))  +  Testna(1,12)*(Z(1,4)-Z(1,5)

so for i =2 , j=1 and n from 1 to k=4  I wanted to have

CC(2,1):= Testna(2,1)*(Z(1,1)-Z(1,2))  +  Testna(2,4)*(Z(1,2)-Z(1,3) +Testna(2,7)*(Z(1,3)-Z(1,4))  +  Testna(2,10)*(Z(1,4)-Z(1,5)

so for i =2 , j=2 and n from 1 to k=4  I wanted to have

CC(2,2):= Testna(2,2)*(Z(1,1)-Z(1,2))  +  Testna(2,5)*(Z(1,2)-Z(1,3) +Testna(2,8)*(Z(1,3)-Z(1,4))  +  Testna(2,11)*(Z(1,4)-Z(1,5)

so for i =2 , j=2 and n from 1 to k=4  I wanted to have

CC(2,3):= Testna(2,3)*(Z(1,1)-Z(1,2))  +  Testna(2,6)*(Z(1,2)-Z(1,3) +Testna(2,9)*(Z(1,3)-Z(1,4))  +  Testna(2,12)*(Z(1,4)-Z(1,5)

and so on.. for i=3, j=3 and n from 1 to K=4

the Problem is that the loop doesnt work as I wanted(above)  and I dont know why, so insted of having a Matrix CC:=[  [C(1,1), C(1,2) C(1,3),], [C(2,1), C(2,2) C(2,3),], [C(3,1), C(3,2) C(3,3)]  ] I become a Matrix CC:=[ [C(1,1), C(1,1) C(1,1),],[C(2,2), C(2,2) C(2,2),],[C(3,3), C(3,3) C(3,3),]]

here is the Maple code
 

Test := proc ()
local i, j, n; global CC, Testna, Z, k:
CC := Matrix(3, 3);
for i from 1to 3 do for
j from 1 to 3 do
for n from 1 to k do
CC(i, j) := CC(i, j)+Testna(i, 1+(n-1)*3)*(Z(1, n)-Z(1, n+1))
end do
end do
end do
end proc():
CC
please Help

After solving something, sometimes the result comes in piecwise. I'd like to just obtain all those results which are not undefined, into a list, so I can process them more easily. I am not sure what is the correct way to do this in Maple.

Here is an example.

restart;
f := piecewise(x>-1 and x<=0, x^3, 
               x>0 and x<=Pi/2, sin(x), 
               x>Pi/2, undefined, 
               x=20, 5, 
               x=50, undefined);

I need to pick all entries that do not have "undefined". I do not need the rhs condition  which is x<=1. So for the above, I'd like to obtain

                               sol:=[ x^3, sin(x), 5]

If there more entries which are also not undefined, they go into the list in order. 

when I do 

sol:=convert(sol,pwlist,x);

This gives     

sol := [0,-1,x^3,0,sin(x), (1/2)*Pi,undefined,20,undefined,20,undefined,50,undefined,50,undefined]

Now it gets confusing. How to change the above to 

       sol:=[ x^3, sin(x), 5]

I do not even understand the conversion result above. I do not know why it gives 50 twice. And I do not even see the "5" in there. So I do not know how to decode this now.

Update:

I found this solution. But it might not be best:

contents :=[op(f)];
[seq(`if`(contents[i]=undefined,NULL,contents[i]),i=2..nops(contents),2)];

gives

              [x^3, sin(x), 5]

Dear all,

Using Typesetting:-Suppress(f(t)) I can suppress the dependency of f(t) in the differential equation eq := {diff(f(t), t) = f(t)}; in the output when I type eq

However, when I want to export the output to LaTeX or MathML using latex(eq) and MathML[ExportPresentation](eq), the dependency on t is still there!

How to remove the dependency on t?

Thank you!

When I have an Operator like

eq:=1/r*diff(r*diff(f(r),r),r)

typically maple evaluates/expands it by product rule.

How can I tell him to not do it?

I tried using the inert operator % but probably i didn't do it right.

First 815 816 817 818 819 820 821 Last Page 817 of 2427