MaplePrimes Questions

Hello there, 

Is there any API that would translate the numerical information to a more informative string?

Or, is there the implementation of the original CoolProp API, 'PhaseSI()', which comes up with a string, instead of the numerical value?

Thank you, 

In Kwon Park  

How is possible to plot two functions in one coordinate system but with different domains?

For example I want to see the both functions f1=x*exp(-x^2-y^2) and f2=exp(-x^2-y^2) in one coordinate system but with different domans as below:
f1: -3<x<3, -2<y<2

f2: -1<x<1, -1<y<2

It's sad when a bug is found for such a simple problem!

sys := [x*y*z = 0, x*y*z + x*z + z = 0, x*y*z + x*y + x = 0]:
solve(sys, {x,y,z});    # OK
#         {x = 0, y = y, z = 0}, {x = x, y = -1, z = 0}

solve(sys, [x,y,z]);    # ???
#                               []

 

Under certain special circumstances it seems that Maple is converting floats to rationals - I noticed this in Maple 2021 when a^0.5 evaluated to sqrt(a). Prior to Maple 2017, a^0.5, evaluates to a^0.5.

Can anyone think of a reason for this change?

I'm not quite sure why it bothers me, but it does

See the attached for Maple 2016 and Maple 2017.

  restart;
  interface(version);
  a^0.5;
  a^(-0.5);

`Standard Worksheet Interface, Maple 2016.2, Windows 7, January 13 2017 Build ID 1194701`

 

a^.5

 

1/a^.5

(1)

 

 

  restart;
  interface(version);
  a^0.5;
  a^(-0.5);

`Standard Worksheet Interface, Maple 2017.3, Windows 7, September 13 2017 Build ID 1262472`

 

a^.5

 

1/a^.5

(1)

 

Download odd2017.mw

Download odd2016.mw

 

Dear Sir/Madam,

Greetings of the day.

If I am considering the value of "gam=0.5,0.7,0.9" in the code other than 1, I am unbale to draw figure using this code. Also, I can not evaluate the values of  A1[200]; A1[400]; A1[600]; A1[800]; A1[1000]. It is showing float undefined.

Please help me in this regard. Thanks in advance

restart 

 

   

f1 := proc (y, t) options operator, arrow; y*sin(t) end proc

NULL

y[0] := .3678794412

h := 0.1e-2; alpha := proc (t) options operator, arrow; .97+0.3e-1*cos((1/10)*t) end proc; gam := .5
NULLNULL

 
for n from 0 to 999 do t[n] := n*h end do

for n from 0 to 0 do y[n+1] := y[n]+h^alpha(t[n])*f1(y[n], t[n])/GAMMA(alpha(t[n])+1) end do

.3678794412

(1)

for n to 999 do y[n+1] := y[0]+gam*h^alpha(t[n])*(sum(t[j]^(gam-1)*((n+1-j)^alpha(t[n])*(n-j+2+alpha(t[n]))-(n-j)^alpha(t[n])*(n-j+2+2*alpha(t[n])))*f1(y[j], t[j])-t[j-1]^(gam-1)*((n+1-j)^(alpha(t[n])+1)-(n-j)^alpha(t[n])*(n-j+1+alpha(t[n])))*f1(y[j-1], t[j-1]), j = 1 .. n))/GAMMA(2+alpha(t[n])) end do

A1[1] := .3678794412

for i to 1000 do A1[i+1] := y[i] end do

NULL

NULL

L := [seq((i-1)*h, i = 1 .. 1001)]NULLNULLNULLNULL

  A1 := [seq(A1[i], i = 1 .. 1001)] 

plot(L, A1, color = red)

 

NULL

A1[200]; A1[400]; A1[600]; A1[800]; A1[1000]

Float(undefined)

 

Float(undefined)

 

Float(undefined)

 

Float(undefined)

 

Float(undefined)

(2)

NULL

``

Download Plot_undefined.mw

The system of equations x*y*z + y*z + y = 21, x*y*z + x*z + z = 30, x*y*z + x*y + x = 12

has three solutions, one of them is not an integer solution.

solve({x*y*z + y*z + y = 21, x*y*z + x*z + z = 30, x*y*z + x*y + x = 12}, {x, y, z})

How can I find three numbers a, b, c so that the system of equations

x*y*z + y*z + y = a, x*y*z + x*z + z = b, x*y*z + x*y + x = c

has three  solutions (x1, y1, z1), (x2, y2, z2), and (x3, y3, z3), where x1, y1, z1, x2, y2, z2, x3, y3, z3 are nine integer numbers.

Hi,

Happy New Years All

Can anyone explain two document formating features I am trying to implement?

1.)  Sections.  I select numbering with follow previous selected and I get three sections with a 1. in front of them vs 1, 2, 3.  

 

I would expect Technical to become 3.1 when properly following Section 3. header.   Also, I have seen how to manually type the section number, but that seems to defeat the document layout and formatting if it gets "jumbled up". 

2.)  Headers.   Can you suppress headers on pages 2 through X to have a unique cover page header?   This would be similar to word (headers and footers linked to previous section, or not(?) with section breaks as new pages)

Thanks,
Bill

I am translating old Maple code to run on Maple 2021.2. This code from 1985. I think it was Maple 3 then. I'll put a link to the paper and page number.

It uses this syntax

Btw, the " above is meant to be % in new Maple. I do not know what w='@W' is supposed to translate to.

The paper is

A DISCUSSION AND IMPLEMENTATION OF KOVACICS ALGORITHM FOR ORDINARY DIFFERENTIAL EQUATIONS

by  Carolyn J. Smith.

Here is the link

https://cs.uwaterloo.ca/research/tr/1984/CS-84-35.pdf

The above is at page 67. Near the end.  The code also uses some old functions, which are not given in the listing, I searched but could not find these.. One is called Lsolve (to solve linear equations, but I can replace this with solve) and  on page 77 it uses these 

           Functions required: scanmap, expcontract, lncontract, explnsimp

These are not given in the source code in the paper. I assume these are old Maple function which no longer exist?. But I can just use simplify for now in their place.

My question is on the use of `@W` and what it could mean? This syntax @ is used in many places in this old Maple code.

Hey all! I recently reinstalled my PC and therefore had to reinstall Maple. I did so and it worked out great, however, minor problem. My PC doesn't recognise .mw files as associated to Maple. I have tried a few different files, but I don't know which one to select as standard program for opening .mw files. Would anyone by chance know which file is the "opener" file, if that´s what that's called.
Thank you for the help in advance :D

(PS: I do know that I can just open the file through Maple by clicking files -> open and locating the file. But I'd rather access them by just doubleclicking from the directory.

Try to prove those two expressions : a sum and product 
First to know if they are correct defined for some values ?

Eulers productformule in Maple

 

 

Eerst de Euler identiteit in Maple opschrijven
via info over series

 

p-Series

sum(1/n^p, n = 1 .. infinity)

Absolute convergence for p > 1

Diverges for p <= 1 

 

 

restart;

sum(1/n^p, n = 1 .. infinity) = product(1/(1-p^(-s)), i = k .. p)

product(f,i=k..n);

product(1/(1 - p^(-s)), i = 1 .. p);

(1-p^(-s))*(-1/(-1+p^(-s)))^(p+1)

(1.1)

sum(1/n^p, n = 1 .. infinity);

sum(1/n^p, n = 1 .. infinity)

(1.2)

sum(1/n^p, n = 1 .. 4);

1+1/2^p+1/3^p+1/4^p

(1.3)

product(1/(1 - p^(-s)), i = 1 .. 4);
            

1/(1-p^(-s))^4

(1.4)

Product(1/(1 - p^(-s)), i = 1 .. 4)= product(1/(1 - p^(-s)), i = 1 .. 4);

Product(1/(1-p^(-s)), i = 1 .. 4) = 1/(1-p^(-s))^4

(1.5)

sum(1/n^p, n = 1 .. infinity) = product(1/(1 - p^(-s)), i = k .. p);

sum(1/n^p, n = 1 .. infinity) = (-1/(-1+p^(-s)))^(p+1)/(-1/(-1+p^(-s)))^k

(1.6)

 

 How to prove this sum(1/n^p, n = 1 .. infinity) = product(1/(1-p^(-s)), i = k .. p)

For the sum i got some terms , but for the product i don't see factors as i use the commands  

Download the_golden_key_in_Maple.mw

I am trying to start writing small procedures in Maple. In the attached document I do not get an answer and I do not understand why. For clarity I have also added a working construct from another program so anyone willing to help me out can better understand what I am after.

Thanks in advance for assistance.

CDI_T_cor.mw

I was trying Maple 2021.2 on this pde I saw on the net, and noticed it gives some error messages. 

Are these to be expected and known?  

interface(version);

`Standard Worksheet Interface, Maple 2021.2, Windows 10, November 23 2021 Build ID 1576349`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1127 and is the same as the version installed in this computer, created 2022, January 3, 14:33 hours Pacific Time.`

restart;

PDE := diff(u(t, x, y), t) = VectorCalculus:-Laplacian(u(t,x,y),'cartesian'[x,y]);
bc := D[2](u)(t,0,y)=0,D[2](u)(t,1,y)=0, u(t, x, 0)=0,u(t, x, 3)=0;
ic := u(0, x, y) = f(x,y);
sol := pdsolve([PDE, bc,ic], u(t,x,y))

diff(u(t, x, y), t) = diff(diff(u(t, x, y), x), x)+diff(diff(u(t, x, y), y), y)

(D[2](u))(t, 0, y) = 0, (D[2](u))(t, 1, y) = 0, u(t, x, 0) = 0, u(t, x, 3) = 0

u(0, x, y) = f(x, y)

Error, (in assuming) when calling '`assume/NormalizeBoolean`'. Received: 'invalid input: type expects 2 arguments, but received 3'

restart;

PDE := diff(u(t, x, y), t) = VectorCalculus:-Laplacian(u(t,x,y),'cartesian'[x,y]);
bc := D[2](u)(t,1,y)=0, u(t, x, 0)=0,u(t, x, 3)=0;
ic := u(0, x, y) = f(x,y);
sol := pdsolve([PDE, bc,ic], u(t,x,y))

diff(u(t, x, y), t) = diff(diff(u(t, x, y), x), x)+diff(diff(u(t, x, y), y), y)

(D[2](u))(t, 1, y) = 0, u(t, x, 0) = 0, u(t, x, 3) = 0

u(0, x, y) = f(x, y)

Error, (in PDEAdvisor/2nd_order/Series/ThreeVariables) invalid input: has expects 2 arguments, but received 1

restart;

pde := diff(u(t, x, y), t) = VectorCalculus:-Laplacian(u(t,x,y),'cartesian'[x,y]);
bc := D[2](u)(t,0,y)=0,D[2](u)(t,1,y)=0, u(t, x, 0)=0,u(t, x, 3)=0;
sol := pdsolve([pde,bc], u(t,x,y))

diff(u(t, x, y), t) = diff(diff(u(t, x, y), x), x)+diff(diff(u(t, x, y), y), y)

(D[2](u))(t, 0, y) = 0, (D[2](u))(t, 1, y) = 0, u(t, x, 0) = 0, u(t, x, 3) = 0

Error, (in PDEAdvisor/2nd_order/Series/ThreeVariables) invalid boolean expression: NULL

 

Download pde_error_messages.mw

Some small differences is unavoidable ?

 

Its not symbolic that's why i don't get he same answers ?
Later on i will investigate some values for for this formula  

Riemanns formidabele formule

 

restart:

Volgens het boekje de riemanns hypothese : de functionaal vergelijking  (zonder bewijs)
Zeta(-z) = ((-2*factorial(z))*(1/(2*Pi)^(z+1)))*sin((1/2)*Pi*z)*Zeta(z+1)

Zeta(-z) = -2*factorial(z)*sin((1/2)*Pi*z)*Zeta(z+1)/(2*Pi)^(z+1)

(1.1)

Zeta(-z) = -2*z!*sin(Pi*z/2)*Zeta(z + 1)/(2*Pi)^(z + 1);

Zeta(-z) = -2*factorial(z)*sin((1/2)*Pi*z)*Zeta(z+1)/(2*Pi)^(z+1)

(1.2)

verg:=%;

Zeta(-z) = -2*factorial(z)*sin((1/2)*Pi*z)*Zeta(z+1)/(2*Pi)^(z+1)

(1.3)

verg2:= subs(z=2+3*I,verg);

Zeta(-2-3*I) = -2*factorial(2+3*I)*sin((1+(3/2)*I)*Pi)*Zeta(3+3*I)/(2*Pi)^(3+3*I)

(1.4)

verg3:= eval(verg,z=2.+3*I);

.1329711559-.1230533004*I = (2.450819690-44.87297744*I)/(2*Pi)^(3.+3.*I)

(1.5)

evalf(rhs(verg3));

.1329711558-.1230533005*I

(1.6)

lhs(verg3)=evalf(rhs(verg3));

.1329711559-.1230533004*I = .1329711558-.1230533005*I

(1.7)

lhs(verg3)- evalf(rhs(verg3));

0.1e-9+0.1e-9*I

(1.8)

 

Download post_naar_primes_over_triemanns_geweldige_formule.mw

I am working on a modelling (simulation) program for an rf system involving DDSs, rf mixers and other components. Each component is programmed as a submodule with methods (procs) and other exports, the whole shebang wrapped into a main package loaded using with(). A loop simulates a number of scenarios with differing starting conditions. Most calculations are numeric in nature.

The code runs but is too slow and in addition seems to keep allocating memory as the main loop runs. I suspect these two are related. I am using profile() to get an idea where the time is spent and where the memory gets eaten up.

I am doing the following:

profile(DDS__Boo:-SetTW,rf__Boo:-cycles,rf__SR:-cycles); # profile these three methods (procs):
.
.
.
# the main loop:
# Loop over injection cycles

for cycle from 1 to Cycles do
  tStartRamp:=(cycle-1)/2;
  c__B0:=cB0f(tStartRamp,tStartRamp);
  cB0List[cycle]:=c__B0;
  WBsum:=0;
  DDS__Boo:-ResetTW(tStartRamp);
#
  targetBucket:=targetList[cycle];
  delta__r:=trunc((r__end-0)/(Points-1));

  for ii from 0 to Points-1 do
    r:=ii*delta__r;
    DDS__Boo:-SetTW((r-delta__r/2)/f__clk,eval(W__Boo+ramp));
    WBsum:=evalf(WBsum+eval(ramp)*delta__r);
  end do:


  BooRfPeriods:=evalf(rf__Boo:-cycles((c__ex+targetBucket)/f__SR));
  SRRfPeriodsList[cycle]:=evalf(rf__SR:-cycles((c__ex+targetBucket)/f__SR));
  BooRfPeriodsList[cycle]:=BooRfPeriods-evalf(rf__Boo:-cycles(c__B0/f__SR)); # rf periods cB0 to extr.
  evalf(BooRfPeriodsList[cycle])/432; # Booster turns c__B0 to extr  
  targetErrors[cycle]:=(%-round(%))*432; # targeting error in bucket width
  DocumentTools:-SetProperty(RotaryGauge0,'value',cycle,'refresh');
end do:
# end loop

showprofile();
function           depth    calls     time    time%         bytes   bytes%
---------------------------------------------------------------------------
SetTW                  1    10240  230.877    51.52   22851828384    72.80
cycles                 1      110  108.607    24.24    4269176160    13.60
cycles                 1      110  108.607    24.24    4269176160    13.60
---------------------------------------------------------------------------
total:                 3    10460  448.091   100.00   31390180704   100.00

My question is: how do I interpret the table of results?

"time" is in seconds? (this should really be written in the Help files). Also, SetTW() and cycles() call other routines from the package, are they included in the times reported or not?

"bytes" is my biggest concern. "SetTW" has a whopping 22 GB against it. Since the total allocation goes up to about 290 MB in this particular run (per Maple's info line) this cannot be the total memory used. Can this be the total allocation (and most of it ending up as garbage and cleaned out)?? Even the 4 GB against cycles seems out-of-line.

The two lines for "cycles" are exactly the same even though the routines differ (belong to different instances of the module and operate on differnt parameters). Is profile aware of that, or not?

I realize that people like to see the whole program or worksheet; but given that this is dependent on a large-ish package and the sheet itself is of some size and difficult to penetrate for the uninitiated I want to spare you from trying to read it. Right now I need to understand what showprofile() is reporting. Once I better understand profiling, and if I need more help, I will try to make a MWE, but I am not that far yet. I did check the Programming Guide but I did not find the info I am looking for.

Thanks much for any insight you can share.

Mac Dude.

I have the following warnings. Could you help me fix the problem?

restart;

deS:=diff(x(t),t)=-0.5*x(t)*y(t)

diff(x(t), t) = -.5*x(t)*y(t)

(1)

deI:=diff(y(t),t)=0.5*x(t)*y(t)-0.15*y(t)

diff(y(t), t) = .5*x(t)*y(t)-.15*y(t)

(2)

with(DEtools):

DEplot([deS,deI],[x(t),y(t)],t=0..40,x=0..1,y=0..0.6,[[x(0)=0.99,y(0)=0]])

Warning, plot may be incomplete, the following errors(s) were issued:
   incorrect number of arguments, got 51, expected 50

 

 

 

 

Download DEtools_example.mw

First 62 63 64 65 66 67 68 Last Page 64 of 2143