Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Contour integration notation

" (∫)[+infinity]^(+infinity)((-x)^(z))/((e)^(x)-1). (ⅆx)/(x)"

 

The limits of integration are intented to indicate a path of integration which begins at + ∞, moves to th e left down the positive real axis, circles the orign once in positive ( counterclockwise) direction, and returns up to the positive real axis to  +∞

-How does this contour look like  in a  graph ?
- the "(ⅆx)/(x)" notation  ?
- calculating this complexe contour integral?

Seems that the concept of the contour integration is similar wit a line integral in real calculus ?

NULL

Download contourintegraal_vraag1.mw

Just wanted to post that I had some data loss because I opened two different workbooks with the same name from different locations.

This could lead to loss of data.

I had code attachments from the "old" workbook implemented in the "new" workbook, while the new code was gone.

Thought always that the round d is reserved for function of two variables x,y , but  that seems to be not the case here ?

restart;

Comparing Different Answers

 

Een antwoord ergens gegeven is

Int(sqrt(x^2+1), x) = (1/2)*x*sqrt(x^2+1)+(1/2)*ln(x+sqrt(x^2+1)) + C                                                             (vb)

 

Mple geeft

 

Int(sqrt(x^2+1),x)=int(sqrt(x^2+1),x)+C[1];

Int((x^2+1)^(1/2), x) = (1/2)*x*(x^2+1)^(1/2)+(1/2)*arcsinh(x)+C[1]

(1)

 

De twee antwoorden lijken nog niet opelkaar !
In het gegeven antwoord staat er een ln en in Maple kan een expressie omgezet worden in ln termen
  

convert(%,ln);

Int((x^2+1)^(1/2), x) = (1/2)*x*(x^2+1)^(1/2)+(1/2)*ln(x+(x^2+1)^(1/2))+C[1]

(2)

(2)  is hetzelfde (vb)

Dezelfde integraal i sook gegeven als

Int(sqrt(x^2+1),x)=((x+sqrt(x^2+1))^2+4*ln(x+sqrt(x^2+1))-(x+sqrt(x^2+1))^(-2))/8+C[2];

Int((x^2+1)^(1/2), x) = (1/8)*(x+(x^2+1)^(1/2))^2+(1/2)*ln(x+(x^2+1)^(1/2))-(1/8)/(x+(x^2+1)^(1/2))^2+C[2]

(3)

Controle

een effectieve manier om twe antwoorden t evergelijken voor hetzelfde probleem is het verschil te berekenen van een vergelijking met de twee integralen

#lhs(%);

#rhs(%%);

 

#diff(lhs(%)-rhs(%)=0,x);

NULL

#diff(f,x);

diff(lhs(%)-rhs(%)=0,x);

(x^2+1)^(1/2)-(1/4)*(x+(x^2+1)^(1/2))*(1+x/(x^2+1)^(1/2))-(1/2)*(1+x/(x^2+1)^(1/2))/(x+(x^2+1)^(1/2))-(1/4)*(1+x/(x^2+1)^(1/2))/(x+(x^2+1)^(1/2))^3 = 0

(4)

simplify(%);

0 = 0

(5)

Strange that  diff(lhs(%)-rhs(%)=0,x);  is translated by 2 d input with round d notation for functions with two variables ?
The two integrals are functions of one variable
diff(f, x)

Download Controleren_dezelfde_antwoord_voo_expressies.mw

system_of_PDE.mw

NULL

NULL

Digits := 30; with(PDEtools); with(plots); Ops1 := numpoints = 100; Ops2 := color = magenta; Ops3 := color = blue; Ops4 := color = "BlueViolet"; Ops5 := axes = boxed, shading = zhue, orientation = [40, 50]; a := 0; b := 1; Tf := .5

axes = boxed, shading = zhue, orientation = [40, 50]

 

.5

(1)

E := 1480

1480

(2)

Ebes := 5990

5990

(3)

n0 := 900000

900000

(4)

ro := 1200

1200

(5)

m := 12.6

12.6

(6)

f := sig(x, t)-Ebes*`ϵij`(x, t)

sig(x, t)-5990*`ϵij`(x, t)

(7)

n := 900000*exp(-(sig(x, t)-E*`ϵij`(x, t))/m)

900000*exp(-0.793650793650793650793650793651e-1*sig(x, t)+117.460317460317460317460317460*`ϵij`(x, t))

(8)

NULL

P := 5

5

(9)

w := 4

4

(10)

k := 7

7

(11)

i := 5

5

(12)

eq1 := diff(sig(x, t), x, x) = ro*(diff(sig(x, t), x, x))/E+ro*(diff(sig(x, t), t)-Ebes*f/(9000000*exp(-(sig(x, t)-E*`ϵij`(x, t))/m)))*(1+f/m)/(9000000*exp(-(sig(x, t)-E*`ϵij`(x, t))/m))

diff(diff(sig(x, t), x), x) = (30/37)*(diff(diff(sig(x, t), x), x))+(1/7500)*(diff(sig(x, t), t)-(599/900000)*(sig(x, t)-5990*`ϵij`(x, t))/exp(-0.793650793650793650793650793651e-1*sig(x, t)+117.460317460317460317460317460*`ϵij`(x, t)))*(1+0.793650793650793650793650793651e-1*sig(x, t)-475.396825396825396825396825397*`ϵij`(x, t))/exp(-0.793650793650793650793650793651e-1*sig(x, t)+117.460317460317460317460317460*`ϵij`(x, t))

(13)

 

eq2 := diff(`ϵij`(x, t), t) = f/(9000000*exp(-(sig(x, t)-E*`ϵij`(x, t))/m))

diff(`ϵij`(x, t), t) = (1/9000000)*(sig(x, t)-5990*`ϵij`(x, t))/exp(-0.793650793650793650793650793651e-1*sig(x, t)+117.460317460317460317460317460*`ϵij`(x, t))

(14)

NULL

sys := {eq1, eq2}

{diff(diff(sig(x, t), x), x) = (30/37)*(diff(diff(sig(x, t), x), x))+(1/7500)*(diff(sig(x, t), t)-(599/900000)*(sig(x, t)-5990*`ϵij`(x, t))/exp(-0.793650793650793650793650793651e-1*sig(x, t)+117.460317460317460317460317460*`ϵij`(x, t)))*(1+0.793650793650793650793650793651e-1*sig(x, t)-475.396825396825396825396825397*`ϵij`(x, t))/exp(-0.793650793650793650793650793651e-1*sig(x, t)+117.460317460317460317460317460*`ϵij`(x, t)), diff(`ϵij`(x, t), t) = (1/9000000)*(sig(x, t)-5990*`ϵij`(x, t))/exp(-0.793650793650793650793650793651e-1*sig(x, t)+117.460317460317460317460317460*`ϵij`(x, t))}

(15)

NULL

IBC1 := {sig(0, t) = P*sin(w*k*i), sig(10, t) = P*sin(w*k*i), sig(x, 0) = 0, sig(x, 1) = 0, `ϵij`(x, 0) = 0}

{sig(0, t) = 5*sin(140), sig(10, t) = 5*sin(140), sig(x, 0) = 0, sig(x, 1) = 0, `ϵij`(x, 0) = 0}

(16)

S := 1/100; Ops := spacestep = S, timestep = S; Sol1 := pdsolve(sys, IBC1, [sig, `ϵij`], numeric, time = t, range = a .. b, Ops)

1/100

 

spacestep = 1/100, timestep = 1/100

 

Error, (in pdsolve/numeric) unable to handle elliptic PDEs

 

``

Download system_of_PDE.mw

I have defined a function II1norm of one variable. The variable has units "microns". It plots perfecting using a range defined in microns, but gives an error when I try to find the root using NextZero. If I just leave off the "microns" in the second argument, NextRoot just reports "FAIL". If I rewite the worksheet without units, then the NextZero executes fine. Why? How to I use units when finding roots?

This is so useful to see geometrical mapping diagram to visualize Complex analysis

Something that also can be made for Maple 

Mapping Diagram for Cauchy Integral Formula – GeoGebra

Using GeoGebra for visualizing complex variable. (google.com)

I highly encourage everyone interested in complex variable to read Tristan Needham „Visual Complex Analysis” and try to solve problems with or without aid of GeoGebra. I hope that in this workshop we will manage to get a feeling of complex functions and as a final point understand how complex integration works. It is a common misconception that complex integration can't be visualized, and using Tristan Needham's ideas we will try to explore this idea. It's a pity that we don't have a lot of time, thus we will skip a lot of important information and construct only some graphs. 

There is so much experimenting with Geogebra software and doing too this in Maple ?

Hello there, 

Would you allow me to ask one question?

Is there any way to get a saturated water vapor pressure value with a temperature outside of the range?

The range here means [273.06 K, 647.096 K]. The pressure value certainly exists (T<273.06 K), but the API only comes up with an error. 

Here is the Maple worksheet where I got into this issue:

restart;

with(ThermophysicalData):

with(CoolProp):        

with(Units[Standard]):

with(ScientificConstants):

T2 := (-40.0 + 273.15) * Unit('K');

233.15*Units:-Unit(K)

(1)

xbb := 1: # 100% steam, saturated.

Pg2 := PropsSI("P", "T", T2, "Q", xbb, "water");

Error, (in ThermophysicalData:-CoolProp:-PropsSI) Temperature to QT_flash [233.15 K] must be in range [273.06 K, 647.096 K] : PropsSI("P","T",233.15,"Q",1,"water")

 

 

Download Q20220111.mw

I must feed the not trivial zeros numbers into this aproximation formula ?

 

Riemann hypothese and staircase of primes

 

restart;

with(NumberTheory)

PrimeCounting(1)

0

(1)

pi(Pi)

2

(2)

PrimeCounting(10000)

1229

(3)

numelems(select(isprime, [seq(1 .. 10000)]))

1229

(4)

The prime counting function is approximated by Li(x) and x/ln(x).

plot([PrimeCounting(x), Li(x), x/ln(x)], x = 1 .. 500, legend = [pi(x), Li(x), x/ln(x)])

The staircase of primes approximated by two functions
Interesting is the video: How i learned to love and fear the Riemann Hypothesis

https://www.quantamagazine.org/how-i-learned-to-love-and-fear-the-riemann-hypothesis-20210104/

NULL

ps:=Array(1..30):
y:=0:
for n from 1 to 30 do
 if is(n,prime)
     then ps[n]:=plot([[n,y],[n,y+1],[n+1,y+1]]):
     y:=y+1;
     else ps[n]:=plot([[n,y],[n+1,y]]):
 end if ;
od;
with(plots):
display({seq(ps[n],n=1..30)}):  

plot([PrimeCounting(x)] ,x = 1 .. 35, legend = [pi(x)]):

plot([PrimeCounting(x), Li(x), x/ln(x)], x = 1 .. 35, legend = [pi(x), Li(x), x/ln(x)])

 

 

 

 

Prime counting function
What found RIEMANN for the prime counting function in relation to the zeta function after he defined the zeta function?

 

He found further a function what follows exactly the shape of the prime counting function

Final discovery v. Riemann.  

- step in the omhoog in de priemtelfunctie = log(p) (zie video)

 

Using the logarithmic primecount function( from Chebyshev) (approximation)
Further  analyse with this Chebyshev approximation formula in relation to the not trivial zero points from Riemann zeta function ( zeros) gives another real function for approximating the primecounting function what uses the non trivial zeros from Riemanns zeta function  in this function:

 

"(not trivial zeros ) u[k ] = "i*w[k]+v[k]   
Number now all nottrivial zeros in the upperhalfplane from down to bottom,  as u[1], u[2], u[3, () .. ()]

"`&varphi;`(x)  := x-ln(2Pi)-1/(2 )ln(1-1/(x^(2))) - (&sum;)2/(|u[k]|) x^(v[k]) cos(w[k] ln(x)-alpha[k])"

NULL

Its only alpha[k] that must be calculated out of the not trivial zeros and i must have a list of  serie of not trivial zeroes from the zeta function. => see Hardy's Z(t) ? from this ..... alpha[k]  can be calculated ?
All not trivial zeros are complex numbers laying on a line ,but  orginating from (0,0) in the complex plane as  vectors to the points    

varphi(x):= x - ln(2*Pi) - 1/2*ln(1 - 1/x^2) - sum(2*x^v[k]*cos(w[k]*ln(x) - alpha[k])/abs(u[k]), k = 1 .. infinity);

x-ln(2*Pi)-(1/2)*ln(1-1/x^2)-(sum(2*x^v[k]*cos(-w[k]*ln(x)+alpha[k])/abs(u[k]), k = 1 .. infinity))

(5)

This formula seems to be correct .
Now how to make a plot ?
Hardy's Z(t) function shows the not trivial zeros in the upperhalfplane of the critical strip of the Riemann zeta function  as zeros in this Z(t) real function : derived from a alternating serie ?

Download priem_staircase_en_riemann_functie.mw

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]);    # ???
#                               []

 

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 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 been experiencing an error in the 2-D math text in Maple 2021. Every time I use the shift button the command seems to double. So if I for instance want to define A:=2 it will write; AA::==2 making the command useless. This only happens in 2-D math.

I have tried restarting Maple, my PC and uninstalling then installing maple 2021 again but nothing changes. This error appeared after updating maple the 6th of january 2022 to Maple 2021.2. I have a MacBook Air M1 2020. 

Please help as I have an exam soon

hello 
i have a long proc i am defining in a loop inside the proc for some reason it calculates the value of a1[j+1] and a2[j+1] and assigns it(in the case of the picture j=1 and in j=2 it doesnt sub) but when it is called again in the next iteration  it doesnt sub the value it just calcluated ! 
i would be so thankful for any help ive been stuck on this for a while now 

I installed the cloud version of Syrup with xmaple, by clicking the cloud icon, etc. It is loaded with xmaple and cmaple. But, not in maple running in emacs.

with(Syrup);
(**) Error, invalid input: with expects its 1st argument, pname, to be of type
{module, package}, but received Syrup
(**) 

Tom Dean

In this example, i have a top module A. Inside it, I have module named my_RECORD (which happened to be option object) that I want to return back to caller when they call a proc.

Maple allows me to declare the proc to return my_RECORD. No problem., But when making a local variable inside the proc and using o::my_RECORD it complains  that my_RECORD does not exist. 

The solution is to change o::my_RECORD to o::A:-my_RECORD

My question why it did not complain the same way on the return value on the proc?   for me, they are both semantically the same. One says the proc returns this type, and the other says the local variable is this type. So why had to do A:-my_RECORD on one but not the other? 

Here is an example. Maple 2021.2 on windows 10.

restart;

interface(warnlevel=4);
kernelopts('assertlevel'=2):

3

A:=module()
 #this is the RECORD to return
  local module my_RECORD()
   option object;
   export data::string:="";
  end module;
   
  export do_analysis:=proc()::my_RECORD;   
    local o::my_RECORD; #error here. But this is the same above line above?    
    o:=Object(my_RECORD);
    o:-data:="test";
    return o;        
  end proc;
end module;

_m2642451182336

A:-do_analysis()

Error, (in do_analysis) type `my_RECORD` does not exist

#FIXED BELOW
restart;

A:=module()
    #this is the RECORD to return
    local module my_RECORD()
        option object;
        export data::string:="";
    end module;
   
    export do_analysis:=proc()::my_RECORD;
          local o::A:-my_RECORD;    
          o:=Object(my_RECORD);
          o:-data:="test";
          return o;        
    end proc;
end module;

_m2642339719872

A:-do_analysis()

module my_RECORD () export data::string; option object; end module

 

Download A_no_lib.mw

1 2 3 4 5 6 7 Last Page 1 of 1877