MaplePrimes Questions

I am stumped at this.

I made a proc A which takes arguments using keywords. When I call A directly, it works. When I pass the argument I want to call A with to another proc B, and then from B call A with that argument, it fails. Maple tells me that it missing arguments. Here is a MWE

restart;
procA := proc({the_equation::`=`:=NULL})
  print("it worked, you passed in ", the_equation);
end proc:

procB :=proc(the_equation)
  print("inside procB, the equation is ", the_equation);
  procA('the_equation'=the_equation); 
end proc:

 

Now, calling procA directly, works

the_equation:= y=3:
procA('the_equation'=the_equation);

              "inside procA, you passed in ", y = 3

But when caling procB, and then have procB call procA, the argument passed in is NULL

procB(the_equation);

                  "inside procB, the equation is ", y = 3
                 "inside procA, you passed in "  <=== WHY NULL?

   

 

 

I must be doing something wrong, I just do not see it.

I am learning argument passing using keyword, which I like more than positional arguments.

I wanted to have an argument which should be only an equation, to be passed in.

So I typed

restart;
foo:=proc({the_equation::`=`:=NULL}) 
   print (the_equation); 
end proc;

And this works when calling it as

the_equation := y=5:
foo('the_equation'= the_equation);

But it does not work, if I put the value of "the_equation" variable in the call itself, like this

foo('the_equation'= y=5);
Error, `=` unexpected

Which is a little strange. So it seems frontend does not like to parse it. A workaround (other than using a variable) is

foo('the_equation'= 'y=5');

Just found it a little odd, that using a variable for y=5 works, but not putting value of the variable  directly there. I thought they should be equivalent.

Since I expected Maple to evaluate and replace the variable "the_equation" back by "y=5" so we end up with the call "foo('the_equation'= y=5);".

But that is not what seems to happen in Maple.

Question is, should the call foo('the_equation'= y=5);  have failed parsing?

Update: rebooting the PC fixed this error for me. Now help comes up OK.

original question:

I am on windows 7, home editon, running Maple 2018.

For some reason, now each time I tried to get help, I get the message that it lost connection with server. I closed Maple, started it up again, and same error happens. Movie below.

This also happend from new worksheet also Each time I type ?anything I get the above.

 

Any idea what can cause it? and where I should look for errors?

I did not nothing before this to anything on system. Was just editing some worksheet which opens fine. It is only help that seems to be having hard time.

 

 

CODE:

sys_ode := 2*C__5*(diff(w(x), x))-C__1*(diff(u(x), x, x))-2*C__4*(diff(w(x), x, x, x))-Q(x) = 0, 2*C__2*u(x)-C__1*(diff(w(x), x, x, x))-2*C__3*(diff(u(x), x, x)) = 0

ics := (D(u))(0) = 1, ((D@@2)(w))(0) = 0, (D(u))(100) = 1, ((D@@2)(w))(100) = 2

 

NOTE:

C__1 to C__5 are constants. 

Following is the screenshot, is there anything wrong with my code?

Thanks for any answer or suggestion!

Dear All

I want to plot A long rod with length L and its cross-section is a rectangle

Hello, 

I am trying to plot 2 equations divided in 3 intervals (tini..tr, tr..te, te..tfin1), but when i try to solve the first equation it appears:

"Warning, cannot evaluate the solution further left of .66099564e18, probably a singularity"

Is it possible avoid this point?

About the second equation, when i try to solve between "te and tr" the program says that the argument is invalid.

Can someone help me?

Here is the program:

restart;

Digits := 20;

M := 0.122e20*0.152e25;
kappa := evalf(sqrt(8*Pi/M^2));
rrhoCC := 0.769e-41*(0.1e-28*0.561e24)*0.152e25^4;

rrhoM0 := 0.1e51;
rrhoR0 := 0;
rrhoM := proc (t) options operator, arrow; rrhoM0/a(t)^3 end proc;
rrhoR := proc (t) options operator, arrow; rrhoR0/a(t)^4 end proc;
pM := proc (t) options operator, arrow; 0 end proc;
eq1 := diff(a(t), t) = a(t)*kappa*sqrt(rrhoM(t)+rrhoCC)/sqrt(3);
eq2 := 2*(diff(a(t), t, t)) = -(1/3)*kappa^2*(rrhoM(t)+3*pM(t)-2*rrhoCC)*a(t);
tini := 0.1e19;
sys1 := {eq1, a(tini) = 1.0};
sys2 := {eq2, a(tini) = 1.0, (D(a))(tini) = 0.284e-17};
with(DEtools);
with(plots);
tfin1 := 0;
te := 10^(-32);
tr := 10^12;
singularities(eq1, a(t));
singularities(eq2, a(t));
p1a := dsolve(sys1, type = numeric, abserr = 10^(-15), relerr = 10^(-15), range = tini .. tr);
p1b := dsolve(sys1, type = numeric, abserr = 10^(-10), relerr = 10^(-10), range = tr .. te);
p1c := dsolve(sys1, type = numeric, abserr = 10^(-10), relerr = 10^(-10), range = te .. tfin1);
fig1a := odeplot(p1a, [t, a(t)]);
fig1b := odeplot(p1b, [t, a(t)]);
fig1c := odeplot(p1c, [t, a(t)], color = red);
display(fig1a, fig1b, fig1c);
p2a := dsolve(sys2, type = numeric, abserr = 1.*10^(-12), relerr = 1.*10^(-12), range = tfin1 .. te);
p2b := dsolve(sys2, type = numeric, abserr = 1.*10^(-12), relerr = 1.*10^(-12), te .. tr);
p2c := dsolve(sys2, type = numeric, abserr = 1.*10^(-12), relerr = 1.*10^(-12), range = tr .. tini);
fig2a := odeplot(p2a, [t, a(t)], color = green);
fig2b := odeplot(p2b, [t, a(t)], color = green);
fig2c := odeplot(p2c, [t, a(t)], color = green);
display(fig2a, fig2b, fig2c);
display(fig1a,fig2a,fig1b,fig2b,fig1c,fig2c);

 

 

 

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. 

First 816 817 818 819 820 821 822 Last Page 818 of 2429