MaplePrimes Questions

There are two opposing commands remove and select in Maple. According to the main help page, StringTools:-RegSplit effectively implies the removal (i.e., capturing substrings that does not match the given pattern), but for extracting the matching parts of the input string (e.g., this example from MatLab), where is the command to carry out the selection?
At present I can do something like 

use StringTools in RegFilter := (p::string, s::string) -> select[2](RegMatch, sprintf("^%s$", p), (op@NGrams)~(s, [`$`](Length(s)))) end:
RegFilter("a.+b", "aabbbaaabb");
 = 
 ["aab", "abb", "aab", "abb", "aabb", "abbb", "aaab", "aabb", 

   "aabbb", "aaabb", "abbbaaab", "aabbbaaab", "abbbaaabb", 

   "aabbbaaabb"]


This is essentially equivalent to letting the matcher keeps starting at the same position until no more new matches are found, while sometimes we just need the matcher to continue the shortest-match testing at the character following the last matched substring after finding a match:

For instance, `RegFilter("a.+?b", "aabbbaaabb", 'overlapped'=⁇);` should return:
⒈`["aab", "aaab"]`,
⒉`["aab", "abb", "aaab", "aab", "abb"]`, or
⒊`["aab", "aabb", "aabbb", "aabbbaaab", "aabbbaaabb", "abb", "abbb", "abbbaaab", "abbbaaabb", "aaab", "aaabb", "aab", "aabb", "abb"]`?

Another disadvantage of it is that it is too inefficient. Considering the following regular expression which matchs email-like strings

sample := Import("https://github.com/mariomka/regex-benchmark/raw/optimized/input-text.txt"): # length:
time[real]((remnants := StringTools:-RegSplit("[a-zA-Z_0-9\\.+-]+@[a-zA-Z_0-9\\.-]+\\.[a-zA-Z_0-9\\.-]+", sample)));
 = 
                             3.157

while if I execute the analogous “timelimit(60, time(RegFilter("[a-zA-Z_0-9\\.+-]+@[a-zA-Z_0-9\\.-]+\\.[a-zA-Z_0-9\\.-]+", sample)));”, Maple will end up running out of memory.

So, where is the StringTools:-RegFilter functionality? Or can we construct those matched cases from remnants and the original text?

Hey my maple document will not open up! When I try to open it, it simply asks me if I want to open my document as maple text, plain text, maple input or simply cancel. No matter which of the options I select the document will just be blank. If anyone can fix it then please help me! I really really need the document since all my notes are in there. I have attached the document to this post.

regards chri69a9

Download Notes_to_Introduction_to_Probability_Theory.mw

Notes_to_Introduction_to_Probability_Theory.mw

I noticed that when I enter an equation into Maple, Greek symols change to English equivalents after a couple of days. E.g. Gamma becomes G , Pi becomes p, but not for all characters.

I haven't noticed any similar effects on mathematical characers or operators, or any other symbols.

RH

I am asking this beacuse I am rusty on using animate in plots. Just trying to show the line segment moving.

restart

with(plottools); with(plots)

Trvl := Matrix(5, 18, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 2, (1, 4) = 3, (1, 5) = 4, (1, 6) = 5, (1, 7) = 6, (1, 8) = 7, (1, 9) = 8, (1, 10) = 9, (1, 11) = 10, (1, 12) = 11, (1, 13) = 12, (1, 14) = 13, (1, 15) = 14, (1, 16) = 15, (1, 17) = 16, (1, 18) = 17, (2, 1) = 25.00000000, (2, 2) = 25.62348980, (2, 3) = 26.24697960, (2, 4) = 26.87046941, (2, 5) = 27.49395921, (2, 6) = 28.11744901, (2, 7) = 28.81795052, (2, 8) = 29.70796779, (2, 9) = 30.69482490, (2, 10) = 31.66997559, (2, 11) = 32.64189447, (2, 12) = 33.63901734, (2, 13) = 34.59934793, (2, 14) = 35.46317753, (2, 15) = 36.17679740, (2, 16) = 36.69583812, (2, 17) = 36.98802824, (2, 18) = 37.03520080, (3, 1) = 9.50000000, (3, 2) = 10.28183148, (3, 3) = 11.06366296, (3, 4) = 11.84549445, (3, 5) = 12.62732593, (3, 6) = 13.40915741, (3, 7) = 14.11748988, (3, 8) = 14.56318511, (3, 9) = 14.69313898, (3, 10) = 14.49329251, (3, 11) = 14.26929209, (3, 12) = 14.29271187, (3, 13) = 14.56209574, (3, 14) = 15.06069470, (3, 15) = 15.75750830, (3, 16) = 16.60921202, (3, 17) = 17.56285107, (3, 18) = 18.55913279, (4, 1) = 26.55872458, (4, 2) = 27.18221431, (4, 3) = 27.80570411, (4, 4) = 28.44091912, (4, 5) = 29.26771501, (4, 6) = 30.27132826, (4, 7) = 31.26754127, (4, 8) = 32.19797655, (4, 9) = 33.15526524, (4, 10) = 34.16855668, (4, 11) = 35.08363639, (4, 12) = 35.87210441, (4, 13) = 36.48493760, (4, 14) = 36.88403298, (4, 15) = 37.04457671, (4, 16) = 36.95658698, (4, 17) = 36.62553455, (4, 18) = 36.06730316, (5, 1) = 11.45457880, (5, 2) = 12.23641019, (5, 3) = 13.01824167, (5, 4) = 13.79066482, (5, 5) = 14.38908368, (5, 6) = 14.67833203, (5, 7) = 14.61699479, (5, 8) = 14.33989949, (5, 9) = 14.25015666, (5, 10) = 14.40907532, (5, 11) = 14.80585186, (5, 12) = 15.41668792, (5, 13) = 16.20360467, (5, 14) = 17.11767545, (5, 15) = 18.10206776, (5, 16) = 19.09557685, (5, 17) = 20.03643114, (5, 18) = 20.86416514})

_rtable[36893489645234278260]

(1)

display(seq(line([Trvl[2, i], Trvl[3, i]], [Trvl[4, i], Trvl[5, i]], color = green), i = 1 .. 18))

 

animate(line([Trvl[2, i], Trvl[3, i]], [Trvl[4, i], Trvl[5, i]], color = green), i = 1 .. 18)

Error, bad index into Matrix

 

NULL

Download 23-11-03_Q_Animate_a_line.mw

Please Help.

I have solve this problem in Runge-Kutta Method but i'm getting error.Can you solve this in RK Method or How to give a code for Shooting Method.

Here is my code.

 HNF1.mw

Dear maple users,

i want to solve these 4 difference scheme equations to calculate the values of U,V,C,T and plot the graphs i verse U by fixing the values

i:=1,Sc:=2,Gr:=5,Gc:=10,DX:=0.02;DR:=0.2,Dt:=:=0.01:m:=7.44,7.88 where ,j=0..5;

eq1[i,j,m]:=(1/(4*DX))*(U[i, j-1,m+1]-U[i-1, j-1,m+1]+U[i,j,m+1]-U[i-1, j,m+1]- U[i-1, j-1,m]+U[i, j,m]-U[i-1, j,m])+(1/(2*DR))*(V[i, j,m+1]-V[i, j-1,m+1]+V[i, j,m]-V[i, j-1,m])+(1/(1+(j-1)*DR))*(V[i, j,m+1]):

eq2[i,j,m]:=(1/Dt)*(U[i, j,m+1]-U[i, j,m])+(U[i, j,m]/(2*DX))*(U[i, j,m+1]-U[i-1, j,m+1]+U[i, j,m]-U[i-1, j,m])+(V[i, j,m]/(4*DR))*(U[i, j+1,m+1]-U[i, j-1,m+1]+U[i, j+1,m]-U[i, j-1,m])=(Gr/2)*(T[i, j,m+1]+T[i, j,m])+(Gc/2)*(C[i, j,m+1]+C[i, j,m])+(1/(2*(DR)^2))*(U[i, j-1,m+1]-2*U[i, j,m+1]+U[i, j+1,m+1]+U[i, j-1,m]-2*U[i, j,m]+U[i, j+1,m])+(1/(4*DR*(1+(j-1)*DR)))*(U[i, j+1,m+1]-U[i, j-1,m+1]+U[i, j+1,m]-U[i, j-1,m]):

eq3[i,j,m]:=(1/Dt)*(T[i, j,m+1]-T[i, j,m])+(U[i, j,m]/(2*DX))*(T[i, j,m+1]-T[i-1, j,m+1]+T[i, j,m]-T[i-1, j,m])+(V[i, j,m]/(4*DR))*(T[i, j-1,m+1]-T[i, j-1,m+1]+T[i, j+1,m]-T[i, j-1,m])=(1/(2*Pr*(DR)^2))*(T[i, j-1,m+1]-2*T[i, j,m+1]+T[i, j+1,m+1]+T[i, j-1,m]-2*T[i, j,m]+T[i, j+1,m])+(1/(4*Pr*DR*(1+(j-1)*DR)))*(T[i, j+1,m+1]-T[i, j-1,m+1]+T[i, j+1,m]-T[i, j-1,m]):
eq4[i,j,m]:=(1/Dt)*(C[i, j,m+1]-C[i, j,m])+(U[i, j,m]/(2*DX))*(C[i, j,m+1]-C[i-1, j,m+1]+C[i, j,m]-C[i-1, j,m])+(V[i, j,m]/(4*DR))*(C[i, j+1,m+1]-C[i, j-1,m+1]+C[i, j+1,m]-C[i, j-1,m])=(1/(2*Sc*(DR)^2))*(C[i, j-1,m+1]-2*C[i, j,m+1]+C[i, j+1,m+1]+C[i, j-1,m]-2*C[i, j,m]+C[i, j+1,m])+(1/(4*Sc*DR*(1+(j-1)*DR)))*(C[i, j+1,m+1]-C[i, j-1,m+1]+C[i, j+1,m]-C[i, j-1,m]):

My file is working, but I am not getting the idea of how to show it at the base as well.For refernce, please see attched picture

Surface_plot.mw

I want to report a bug.

This was possible in MaplePrimes but I cannot find the option software change request (if i remember correctly) any more. Hast this option moved or been removed?

systems of Nonlinear equations : 

EQ1 := 0.6250000000e-3*Omega^2*R[2]^6+0.4500000000e-2*Omega^2*R[2]^4+(Omega^4-1.9919*Omega^2+1)*R[2]^2-0.225e-1*Omega^2*R[1]^2 = 0;
EQ2 := (.2916*Omega^6+0.225e-1*U^2)*R[1]^6+(-0.9936e-1*Omega^4*U^2+1.296*Omega^4*U-1.20*Omega^2*U^2+1.20*U^2)*R[1]^4+(16*Omega^4*U^2+0.8464e-2*Omega^2*U^4-.2208*Omega^2*U^3-30.56*Omega^2*U^2+16*U^2)*R[1]^2-2.56*U^2*R[2]^2 = 0;
EQ3 := 0.3164062500e-4*Omega^2*R[1]^8+0.1687500000e-2*Omega^2*(-Omega^2+1)*R[1]^6+0.225e-1*Omega^2*(-Omega^2+1)^2*R[1]^4-0.3600e-2*Omega^2*R[1]^2*R[2]^2+.16*(Omega^2-1)^2*R[2]^4 = 0;

Please, I would like writing the pochhammer's symbols or rising factorials in a nice way.

Trying

nicepo:=(a,b)->(a)[b];

apparently works, however the output of

substitute(pochhammer=nicepo,pochhammer(1/2,n));

is nicepo(1/2,n), and not the output I would like, namely (1/2)[n].

Is there a way of getting the output I want?

May be someone could help me understand the logic that Maple goes through in this example.

restart;
ode:=diff(y(x), x) = sqrt(y(x))*sin(x);
dsolve([ode,y(0)=0]);
dsolve([ode,y(0)=0],'implicit');

For first dsolve it returns y(x)=0 and for the second it returns what is expected which is sqrt(y(x)) + cos(x)/2 - 1/2 = 0

Why this difference in result? Just trying to understand the logic behaind it. 

Maple 2023.1 on windows 10

``

restart;

ode:=diff(y(x), x) = sqrt(y(x))*sin(x);
dsolve([ode,y(0)=0]);
dsolve([ode,y(0)=0],'implicit');

diff(y(x), x) = y(x)^(1/2)*sin(x)

y(x) = 0

y(x)^(1/2)+(1/2)*cos(x)-1/2 = 0

 

Download why_dsolve.mw

Hi, how can I apply classic geometric transformations (rotation, scaling, reflection, etc.) to an imported photo? For example, with this image

Thanks

The document block (copied from a larger document) in the attached file could be executed with Maple 2022 (in the larger document).

Maple 2023 evaluates... that I have to interrupt.

On my installation I cannot convert the block to 1d input to investigate for hidden characters. This works in 2022.

Trying to manipulate (splitting, cutting, ...) the block lead several times to the 2023 GUI not responding normally which required Maple restart.

What I found with Maple 2022 and lprint: There is a ndash character here

Ein Bild, das Text, Schrift, Reihe enthält.

Automatisch generierte BeschreibungEin Bild, das Schrift, Reihe, Handschrift, weiß enthält.

Automatisch generierte Beschreibung

which must be deleted in the attached file. The larger document does not lprint a ndash. So this might be a copy/paste artefact and is perhaps unrelated to the evaluation problem with 2023.

With Maple 2023 there is no ndash but the output looks differentEin Bild, das Schrift, Diagramm, Reihe, Design enthält.

Automatisch generierte Beschreibung

The whole thing is perhaps related to this

Can someone reproduce and/or help?


 

interface(version)

`Standard Worksheet Interface, Maple 2023.1, Windows 10, July 7 2023 Build ID 1723669`

(1)

exp(`–`((1/2)*x^2)-(1/2)*y^2)/(2*Pi)

(1/2)*exp(-(1/2)*x^2-(1/2)*y^2)/Pi

(2)

`if`(evalf((1/2)*exp(-(1/2)*x^2-(1/2)*y^2)/Pi) < 0.7957747150e-1, (1/2)*exp(-(1/2)*x^2-(1/2)*y^2)/Pi, NONE); p3 := plot3d(%, x = -3 .. 3, y = -3 .. 3, color = blue); `if`(evalf((1/2)*exp(-(1/2)*x^2-(1/2)*y^2)/Pi) < 0.2153927929e-1, (1/2)*exp(-(1/2)*x^2-(1/2)*y^2)/Pi, NONE); p4 := plot3d(%+0.1e-3, x = -3 .. 3, y = -3 .. 3, color = red)

Warning,  computation interrupted

 

NULL


 

Download plot3d_in_2023_not_working.mw

I'm scratching my head to understand this behaviour of MultiSeries. If I type

MultiSeries[series](diff(ln(GAMMA(1/x)), x), x)

Maple 2022.2 answers

MultiSeries[series](diff(ln(GAMMA(1/x)), x), x)

But as is known (and maple confirms)

diff(ln(GAMMA(x)), x)=Psi(x)

But prompting in maple 

MultiSeries[series](Psi(1/x), x)

It answers

MultiSeries[series](Psi(1/x), x)

that is off by a x^2 factor with the former answer, while one expects to obtain the same answer as before. Why is this? (I tried assuming positivity, same discrepancy results).


For several hours I experience difficulties to upload a mw file (file LaneEmdenNumeric.mw to answer this question).

Given the error message I get

I thought it was a general technical problem.

But then I realized that this file ColumnSorting_4.mw , for instance, could be uploaded.

Nevertheless, as soon as I try to upload LaneEmdenNumeric.mw I get the error displayed above and it becomes impossible to upload any other file, even ColumnSorting_4.mw.

Does someone has any idea about what's going on?
TIA

For the record, LaneEmdenNumeric.mw contains nothing special that could prevent its uploading.
This file can be uploaded here  DropBox  (replace the txt extension by mw before opening it with Maple).

First 10 11 12 13 14 15 16 Last Page 12 of 2282