Maple 2018 Questions and Posts

These are Posts and Questions associated with the product, Maple 2018

restart:
PDEtools[declare](f(x), prime = x):
PDEtools[declare](Theta(x), prime = x):
PDEtools[declare](Phi(x), prime = x):
N := 4; M := .1; Kp := .1; Gr := 0.1e-1; Gc := 0.1e-1; Pr := 1; S := 0.1e-1; Sc := .78; Kc := 0.1e-1; La := 1
f (x):=  sum((p^(i))*f [i] (x), i = 0 .. N) ;
Theta(x):=  sum((p^(i))*Theta[i] (x), i = 0 .. N) ;
Phi(x):= sum((p^(i))*Phi [i] (x), i = 0 .. N);
HPMEq1 := (1-p)*(diff(f(x), x, x, x))+p*(diff(f(x), x, x, x)+(1/2)*(diff(f(x), x, x))*f(x)-(M^2+Kp)*(diff(f(x), x)-La)+Gr*Theta(x)+Gc*Phi(x))
HPMEq2 := (1-p)*(diff(Theta(x), x, x))/Pr+p*((diff(Theta(x), x, x))/Pr+(1/2)*(diff(Theta(x), x))*f(x)+S*Theta(x))
HPMEq3 := (1-p)*(diff(Phi(x), x, x))/Sc+p*((diff(Phi(x), x, x))/Sc+(1/2)*(diff(Phi(x), x))*f(x)+Kc*Phi(x))
for i from 0 to N do equ[1][i] := coeff(HPMEq1, p, i) = 0 end do
for i from 0 to N do equ[1][i] := coeff(HPMEq2, p, i) = 0 end do
for i from 0 to N do equ[1][i] := coeff(HPMEq3, p, i) = 0 end do
cond[1][0] := f[0](0) = 0, (D(f[0]))(0) = 0, Theta[0](0) = 1, Phi[0](0) = 1, Theta[0](5) = 0, Phi[0](5) = 0, (D(f[0]))(5) = 1; for j to N do cond[1][j] := f[j](0) = 0, (D(f[j]))(0) = 0, Theta[j](0) = 0, Phi[j](0) = 0, Theta[j](5) = 0, Phi[j](5) = 0, (D(f[j]))(5) = 0 end do
for i from 0 to N do pdsolve({cond[1][i], equ[1][i]}, f[i](x)); f[i](x) := rhs(%) end do
f(x) := evalf(simplify(sum(f[n](x), n = 0 .. N))); convert(f(x), 'rational'); subs(x = 1, diff(f(x), x))

Please rectify the error
Thank you

Can Maple prove this simple identity  binomial(2*n, n)/2 = binomial(2*n-1, n-1) ,where n is integer and positive. Doing it manually is very easy. My attempt was unsuccessful:

is(binomial(2*n, n)/2=binomial(2*n-1, n-1)) assuming n::posint;

                                                       FAIL

Good day. 

I have been looking into the time series features in Maple and was eager to apply the models to one specific example containing 47 data points (attached).

When I run the ESM routine, Maple provides a forecast based on a (A,N,N) configuration. You will notice that the forecast for the following 12 data points is a constant value. I have also noticed this for several other data set examples and I would have expected the predictions to vary across the next 12 data points.

Does the (A,N,N) configuration in Maple automatically provide an optimal forecast and can anyone advise me on how to specify all possible combinations of (error, trend, season) models?

Thanks you for reading.

MaplePrimes_TS_Example.mw

Dear All

Same calculation, but Maple gave 2 different results, when I used 2 different input methods, using palettes and through Maple Tutors, respectively (image). Can someone explain to me the reason?

Good Day.

I have attached a worksheet for a time series that comprises 45 data points. I would like to investigate the overall demand (for forecasting purposes) and to isolate the underlying demand components; that is, trend, level, seasonal, and residual. However, I have difficulty in distinguishing each component in the plot as the colors appear to be similar and some may have relatively small values.

Does anyone know how to recolor these components so they appear to be more obvious? It would be also beneficial to isolate and plot each individual component - can that be done?

Thanks for your interest!

MaplePrimes_Time_Series.mw

Hello.

If I input 'floor(5.5)' in Maple 2018 I get the expected \lfloor 5.5 \rfloor thing.  I mean, with the special brackets typical for the floor notation.

However, if I try to place the floor notation onto a plot I get literally the string "floor(5.5)".  As in

  textplot([2, 2, 'floor(5.5)'])

The ' ' quotation marks ensure the delayed evaluation but I do not get the floor parentheses! 

Interestingly,

  textplot([2, 2, 'sqrt(5.5)'])

outputs the radical notation as expected.

How come I cannot produce a plot with the floor brackets notation in it?

Thanks

Minko

Pls see below worksheet. I want to compute the maximum number that appears in the Collatz series when starting with several starting numbers.

I calculate the maximum number appearing when starting with a specific number in procedure collatz. Then I want to calculate the maximum number appearing when calling different starting numbers in procedure collatz_max by calling collatz several times - collatz_max does not yet contain the handing of the results from collatz as the below error appears. If I only call collatz in collatz_max it return the right value, but in the loop or if I assign collatz to a variable within procedure collatz_max, calling collatz returns () as a result.

What do I do wrong?

Thanks for helping,

Oliver

Collatz.mws

restart

eq1 := (2*(r^2+a^2*cos(theta)^2))*(M*r-(1/2)*a^2-(1/2)*r^2)*(diff(f(r, theta), r, theta))+(2*(a^2*(M-r)*cos(theta)^2-M*r^2+a^2*r))*(diff(f(r, theta), theta))

2*(r^2+a^2*cos(theta)^2)*(M*r-(1/2)*a^2-(1/2)*r^2)*(diff(diff(f(r, theta), r), theta))+2*(a^2*(M-r)*cos(theta)^2-M*r^2+a^2*r)*(diff(f(r, theta), theta))

(1)

eq2 := sin(theta)*(r^2+a^2*cos(theta)^2)*(diff(f(r, theta), theta, theta))-cos(theta)*(diff(f(r, theta), theta))*(a^2*cos(theta)^2-2*a^2-r^2)

sin(theta)*(r^2+a^2*cos(theta)^2)*(diff(diff(f(r, theta), theta), theta))-cos(theta)*(diff(f(r, theta), theta))*(a^2*cos(theta)^2-2*a^2-r^2)

(2)

eq3 := -2*(r^2+a^2*cos(theta)^2)^2*(M*r-(1/2)*a^2-(1/2)*r^2)*sin(theta)*(diff(g(r, theta), r, r))+sin(theta)*(r^2+a^2*cos(theta)^2)^2*(diff(g(r, theta), theta, theta))+(4*(-(1/4)*cos(theta)^4*a^4+a^2*r*(M-(1/2)*r)*cos(theta)^2-M*a^2*r-(1/4)*r^4))*cos(theta)*(diff(g(r, theta), theta))-2*M*sin(theta)*(diff(g(r, theta), r))*(a^2+r^2)*(cos(theta)*a-r)*(cos(theta)*a+r)

-2*(r^2+a^2*cos(theta)^2)^2*(M*r-(1/2)*a^2-(1/2)*r^2)*sin(theta)*(diff(diff(g(r, theta), r), r))+sin(theta)*(r^2+a^2*cos(theta)^2)^2*(diff(diff(g(r, theta), theta), theta))+4*(-(1/4)*cos(theta)^4*a^4+a^2*r*(M-(1/2)*r)*cos(theta)^2-M*a^2*r-(1/4)*r^4)*cos(theta)*(diff(g(r, theta), theta))-2*M*sin(theta)*(diff(g(r, theta), r))*(a^2+r^2)*(cos(theta)*a-r)*(cos(theta)*a+r)

(3)

pdsolve([eq1, eq2, eq3])

[{f(r, theta) = _F1(r)+(Int((r^2+a^2*cos(theta)^2)/((cos(theta)+1)^(1/2)*(cos(theta)-1)^(1/2)), theta))*_C1/(2*M*r-a^2-r^2)}, [diff(diff(g(r, theta), r), r) = (sin(theta)*(sin(theta)^2*a^2-a^2-r^2)^2*(diff(diff(g(r, theta), theta), theta))-4*cos(theta)*((1/4)*a^4*sin(theta)^4+(-(1/2)*a^2+r*(M-(1/2)*r))*a^2*sin(theta)^2+(1/4)*(a^2+r^2)^2)*(diff(g(r, theta), theta))+2*M*sin(theta)*(diff(g(r, theta), r))*(a^2+r^2)*(sin(theta)^2*a^2-a^2+r^2))/(sin(theta)*(sin(theta)^2*a^2-a^2-r^2)^2*(2*M*r-a^2-r^2))]]

(4)

``

Download pde1.mw

SlitRecoil.mw

At line 46 I do some integrals of a probablity function obainted from complex amplitudes. The plot of the function is shown above. However, the integral suddlenly drops to almost nothing when I increase the limits from +/- 0.195 to +/-0.2. The transition actually occus at ~0.196 (not shown)

This makes no sense. It doesn't seem  from the plot that the step size could get so large as to miss the peak! However, I don't know how to change numerical integral step size to test that.

---Arthur (a.k.a. Traruh)

Hello. There is some system of differential equations with respect to the unknowns u1(x), u2(x), u3(x) with boundary conditions. Solved numerically using the dsolve command.
Is it possible to build a graph of a function of the form W=a*u1(x)+b*u2(x)+c*u3(x) based on this solution?

Thank you for your answers.

Hi

I want to solve two equations (Eqmin and Eqmax) numerically  and plot curves of Mmin and Mmax versus "sigma" in one frame, But the  second curve (Mmax) is not plotted !  What should I do? 
(We know that only real and positive roots are acceptable)
Eq.mw

eq1 := f(r)*((diff(g(t, phi, r), t))*a^2+(diff(g(t, phi, r), t))*r^2+a*(diff(g(t, phi, r), phi)))/(sqrt(-g(t, phi, r)^2*f(r)^2+1)*sqrt(-(r^2+a^2*cos(theta)^2)*(2*M*r-a^2-r^2)))

f(r)*((diff(g(t, phi, r), t))*a^2+(diff(g(t, phi, r), t))*r^2+a*(diff(g(t, phi, r), phi)))/((-g(t, phi, r)^2*f(r)^2+1)^(1/2)*(-(r^2+a^2*cos(theta)^2)*(2*M*r-a^2-r^2))^(1/2))

(1)

eq2 := (((-a*cos(theta)^2+a)*f(r)^2*g(t, phi, r)^2+a*cos(theta)^2-a)*(diff(g(t, phi, r), phi, t))+(g(t, phi, r)^2*f(r)^2-1)*(diff(g(t, phi, r), phi, phi))+(-(diff(g(t, phi, r), phi))+(diff(g(t, phi, r), t))*a*(cos(theta)-1)*(cos(theta)+1))*(diff(g(t, phi, r), phi))*f(r)^2*g(t, phi, r))*f(r)/((-g(t, phi, r)^2*f(r)^2+1)^(3/2)*sin(theta))

(((-a*cos(theta)^2+a)*f(r)^2*g(t, phi, r)^2+a*cos(theta)^2-a)*(diff(diff(g(t, phi, r), phi), t))+(g(t, phi, r)^2*f(r)^2-1)*(diff(diff(g(t, phi, r), phi), phi))+(-(diff(g(t, phi, r), phi))+(diff(g(t, phi, r), t))*a*(cos(theta)-1)*(cos(theta)+1))*(diff(g(t, phi, r), phi))*f(r)^2*g(t, phi, r))*f(r)/((-g(t, phi, r)^2*f(r)^2+1)^(3/2)*sin(theta))

(2)

pdsolve([eq1, eq2])

Error, (in pdsolve/sys) found the element '_F4' repeated in the indication of blocks variables

 

``

Download problemfile.mw

I am trying to solve these two coupled PDE and am getting this error. Does anyone know what this mean?

Hello everyone,

I'm not quite sure, if this is the correct place but i think i found a bug in the analytic integration tool in Maple.

Since i have the student edition and i didn't find a bug report form i will post it here:

restart:

R:=1:
delta:=1:

f:=R^4*delta*cos(theta)*sin(x)*sin(-x+theta)/(8*Pi*(R^2*cos(x)+sqrt(2*R^2*cos(x)+2*R^2+4*delta^2)*delta+R^2+2*delta^2));


intfAna:=int(f,x= -Pi + theta .. Pi+ theta);

intfNum:=Int(f,x= -Pi + theta .. Pi+ theta);
intNum:=evalf(Int(eval(intfNum),theta=0..2*Pi));
intAna:=evalf(int(eval(intfAna),theta=0..2*Pi));

the last two statements yield:

                    intNum := -0.07343950362
                    intAna := -0.7853981635

Thus the numerical integrated value differes from the analytical result.

Since I also tried to integrate this with scipy in python I'm pretty sure that the numerical result is correct  and the analytical one is not.

Is my deduction here correct?

I have Maple 2018 here on my private PC. But at work i have Maple 2021 and the difference is the same.

 

Interestingly the analytic result seems to be -cos(theta)^2/4. If we plot the analytical and numerical integrand, we get:

plot(intfNum,theta=0..2*Pi);
plot(intfAna,theta=0..2*Pi);

 

Thus both integrands seem to be cosines of theta but the analytical has the wrong factor.

Thanks in advance!

When I export a very simple Maple 2018 (MaxOS) document to Latex, this tex file results:

 

%% Created by Maple 2018.2, Mac OS X

%% Source Worksheet: untitled 3

%% Generated: Sun Jul 03 16:34:49 CEST 2022

\documentclass{article}

\usepackage{maplestd2e}

\def\emptyline{\vspace{12pt}}

\begin{document}

\pagestyle{empty}

\DefineParaStyle{Maple Bullet Item}

\DefineParaStyle{Maple Heading 1}

\DefineParaStyle{Maple Warning}

\DefineParaStyle{Maple Heading 4}

\DefineParaStyle{Maple Heading 2}

\DefineParaStyle{Maple Heading 3}

\DefineParaStyle{Maple Dash Item}

\DefineParaStyle{Maple Error}

\DefineParaStyle{Maple Title}

\DefineParaStyle{Maple Text Output}

\DefineParaStyle{Maple Normal}

\DefineCharStyle{Maple 2D Output}

\DefineCharStyle{Maple 2D Input}

\DefineCharStyle{Maple Maple Input}

\DefineCharStyle{Maple 2D Math}

\DefineCharStyle{Maple Hyperlink}

\begin{Maple Normal}{

\begin{Maple Normal}{

\mapleinline{inert}{2d}{restart; 1}{\[\displaystyle \]}

}\end{Maple Normal}

}\end{Maple Normal}

\begin{Maple Normal}{

\begin{Maple Normal}{

\mapleinline{inert}{2d}{a := b^2-sqrt(4); "_noterminate"}{\[\displaystyle \]}

}\end{Maple Normal}

}\end{Maple Normal}

\begin{maplegroup}

\begin{Maple Normal}{

\mapleinline{inert}{2d}{a := b^2-sqrt(4); "_noterminate"}{\[\displaystyle \]}

}\end{Maple Normal}

\mapleresult

\begin{maplelatex}

\mapleinline{inert}{2d}{a := b^2-2; "_noterminate"}{\[\displaystyle \]}

\end{maplelatex}

\end{maplegroup}

\begin{Maple Normal}{

\begin{Maple Normal}{

\mapleinline{inert}{2d}{a := b^2-sqrt(4); "_noterminate"}{\[\displaystyle \]}

}\end{Maple Normal}

}\end{Maple Normal}

\begin{maplegroup}

\begin{Maple Normal}{

\mapleinline{inert}{2d}{a := b^2-sqrt(4); "_noterminate"}{\[\displaystyle \]}

}\end{Maple Normal}

\mapleresult

\begin{maplelatex}

\mapleinline{inert}{2d}{a := b^2-2; "_noterminate"}{\[\displaystyle \]}

\end{maplelatex}

\end{maplegroup}

\begin{Maple Normal}{

\begin{Maple Normal}{

\mapleinline{inert}{2d}{}{\[\displaystyle \]}

}\end{Maple Normal}

}\end{Maple Normal}

\end{document}

 

However, when trying to process the tex file in both Overleaf and TexShop the pdf output is only an empty page. No error occurs, i.e. the maplestd2e.sty file is recognised by both Overleaf and TexShop.

 

What is going wrong here?

Good day.

I am working on a network flow problem that uses a linear programming (simplex) technique.The flow is directed across 3 regions (a, b, and c) and there are 2 nodes within region a, 4 nodes in region b, and 5 nodes in region c.

I wish to determine the minimum cost from regions a to c and from regions b to c that satisfies the requirement of each of the 5 nodes in region c. The objective and constraints are constructed and Maple produces the minimum solution (see attached). While the output is useful when the number of nodes is small, I would like to extend this to a larger-scale case and so the output would need to be more user-friendly / graphic.

I have 2 questions - 

1. Does anyone know a way to attach labels for each region and each node to these solution matrices?
    For instance -  the first matrix, x, specifies a quantity of 2,000 that flows from node #1 in region a to node #2 in region b
2. Is it possible to produce a network graph showing the directed flow from each region and from node to node?

Thanks to all for reading this!

MaplePrimes_Network.mw

3 4 5 6 7 8 9 Last Page 5 of 61