## Solve ODE in fourier space numerically and transfo...

Dear all,

consider two lists of complex values :

list1 := [l1,l2,l3,l4,l5]

list2 := [s1,s2,s3,s4,s5].

There is a set of second order differential equation

d^2u(k)/dt^2+I*A*du/dt-B*u=0

where A is sum of elements of list1 and list2 and B is multiplication of their element. Therefore,

d^2u[1](k)/dt^2+I*(l1+s1)*du[1]/dt-(l1*s1)*u[1]=0

d^2u[2](k)/dt^2+I*(l2+s2)*du[2]/dt-(l2*s2)*u[2]=0

d^2u[3](k)/dt^2+I*(l3+s3)*du[3]/dt-(l3*s3)*u[3]=0

d^2u[4](k)/dt^2+I*(l4+s4)*du[4]/dt-(l4*s4)*u[4]=0

d^2u[5](k)/dt^2+I*(l5+s5)*du[5]/dt-(l5*s5)*u[5]=0

How can I create a set of differential equations and initial conditions based on nops(list1), then solve this system of differential equations numerically in Maple.

since u[i] are function of k, next step is to transforme them to real space by inverse fourier transform.

finally save the results and plot them.

Note that for simplisity I wrote a linear equation but it is not. so, because of nonlinear terms it is not possible to use superposition of the solution. I have to take them as coupled system of equations.

====

for example

list1 := [ [0., -5.496799068*10^(-15)-0.*I], [.1, 5.201897725*10^(-16)-1.188994754*I], [.2, 6.924043163*10^(-17)-4.747763855*I], [.3, 2.297497722*10^(-17)-10.66272177*I], [.4, 1.159126178*10^(-17)-18.96299588*I] ]

list2 :=[ [0., -8.634351786*10^(-7)-67.81404036*I], [.1, -0.7387644021e-5-67.76491234*I], [.2, -0.1433025271e-4-67.59922295*I], [.3, -0.2231598645e-4-67.25152449*I], [.4, -0.3280855430e-4-66.56357035*I] ]

where first element is k and the second value is l_i and s_i

the differential equation is

ode_u[i]:= diff(u[i](t),t\$2)+I*(list1[i][2]+list2[i][2])*diff(u[i](t),t)-list1[1][2]*list2[2][2]*u[i](t)=0;

eta is in fourier space where k values are in list1[i][1].

We laso know that f(-k)= - f*(k) where f=list[i][2]

and u[i] as function of k, initially has a Gaussian shape at t=0 in fourier space..

## How do I solve a nonlinear coupled differential eq...

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))

Thank you

## How to prove the identity binomial(2*n, n)/2=bino...

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

## How can I specify all possible forecast models in ...

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?

MaplePrimes_TS_Example.mw

## The results are not the same...

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?

## How can I distinguish between the components of a ...

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?

MaplePrimes_Time_Series.mw

## The floor brackets are not displayed on plots -- w...

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

## Calling Procedure from Procedure...

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

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >

## Problem with inconstant integration of probablity ...

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)

## Numerical solution of the boundary value problem f...

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?

## Why my second curve is not plotted?...

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

## What does this error mean in pdsolve?...

 >
 (1)
 >
 (2)
 >
 >

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

## Bug in analytic integration...

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.

## Maple to Latex - empty page pdf only...

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 Warning}

\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}

\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?

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