Maple Questions and Posts

These are Posts and Questions associated with the product, Maple
 
While solving a math problem, one has to deal with a system of 25 linear equations with a parameter s (Laplace transform variable). i tried formulating the system in a matrix form using GenerateMatrix and inverting the system using solve with LU or QR method but without success. i attach a minimal working environment for the system of equations at hand. Any help or advice is highly appreciated – thank you!
 

PDE:

(a+b)*(uxx+vxy)+c*laplacian(u)=0

 

(a+b)*(vxy+vyy)+c*laplacian(v)=0

 

a,b,c=const.  Initial:u=1/2*sin(2*theta),v=cos(theta)

 

Text book says: Solve by complex variable method

Dear all

I have a PDEs depend on u1(r,z) 
I would like to decompose u1 as sum of two function c1*r*U(z)+u(r,z) and  , where c1 is constant,  then i would like to substitute u1 in the pde by   c1*r*U(z)+u(r,z) then obtain the corresponding new equation

subs_function.mw

thank you 

 

Download FeynmanIntegrals.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Is there a way to make a library file that automatically has the functions/procedures loaded on startup and after it any new or open ".mw" can use functions/procedures from library with no redefinition?

I have a table that includes the numeric and exact solution of a complex PDE.

I want to calculate error between exact and numeric solution. 
Question 1: Which type of error is mostly used for complex solutions? Absolute error or relative error ,ecludian norm error etc.

Question 2: How to calculate absolute error in complex solutions?

 |abs(Exact_Solution)-abs(Numeric_Solution)|

or

|abs(Exact_Solution-Numeric_Solution)|

 

restart:
interface(rtablesize=19):
Table_1:=Matrix(19,4,{(1, 1) = x, (1, 2) = t, (1, 3) = Exact_Solution, (1, 4) = 
Numeric_Solution, (2, 3) = .58480350959087385609+1.0129093910559867400*I, (2, 4
) = .58480354764257321311+1.0129094569634633407*I, (3, 2) = .2, (3, 3) = .58507\
763625784549559+1.0133841923708911330*I, (3, 4) = .58507767430954485264+1.01338\
42582783677337*I, (4, 2) = .4, (4, 3) = .58590001649935378049+1.014808596732324\
2462*I, (4, 4) = .58590005455105313755+1.0148086626398008469*I, (5, 2) = .6, (5
, 3) = .58727066619506620449+1.0171826316446769860*I, (5, 4) = .587270690527719\
69197+1.0171826737900691093*I, (6, 2) = .8, (6, 3) = .58918956627727806829+1.02\
05062640817160297*I, (6, 4) = .58918959060993155574+1.0205063062271081530*I, (7
, 2) = 1.0, (7, 3) = .59165666981620797589+1.0247794127586756112*I, (7, 4) = .5\
9165677643905044333+1.0247795974348560123*I, (8, 1) = .5, (8, 3) = .59165805893\
555155139+1.0247818187839564608*I, (8, 4) = .59165677643905044333+1.02477959743\
48560123*I, (9, 1) = .5, (9, 2) = .2, (9, 3) = .58919046685310110177+1.02050782\
39247975919*I, (9, 4) = .58918959060993155574+1.0205063062271081530*I, (10, 1)
= .5, (10, 2) = .4, (10, 3) = .58727131671750391922+1.0171837583825905714*I, (
10, 4) = .58727069052771969197+1.0171826737900691093*I, (11, 1) = .5, (11, 2) =
.6, (11, 3) = .58590207620818846348+1.0148121642526747156*I, (11, 4) = .5859000\
5455105313755+1.0148086626398008469*I, (12, 1) = .5, (12, 2) = .8, (12, 3) = .5\
8507958971290229630+1.0133875758542998141*I, (12, 4) = .58507767430954485264+1.\
0133842582783677337*I, (13, 1) = .5, (13, 2) = 1.0, (13, 3) = .5848057178847424\
9287+1.0129132159331652617*I, (13, 4) = .58480354764257321311+1.012909456963463\
3407*I, (14, 1) = 1.0, (14, 3) = .61222010009837745680+1.0603963187852935669*I,
(14, 4) = .61222010009837745677+1.0603963187852935669*I, (15, 1) = 1.0, (15, 2)
= .2, (15, 3) = .60700988526763399480+1.0513719619800970123*I, (15, 4) = .60700\
988526763399480+1.0513719619800970123*I, (16, 1) = 1.0, (16, 2) = .4, (16, 3) =
.60234868471511732616+1.0432985257988700194*I, (16, 4) = .60234868471511732617+
1.0432985257988700194*I, (17, 1) = 1.0, (17, 2) = .6, (17, 3) = .59823621894610\
415849+1.0361755261425513984*I, (17, 4) = .59823621894610415846+1.0361755261425\
513983*I, (18, 1) = 1.0, (18, 2) = .8, (18, 3) = .59467229263079952050+1.030002\
6246900120270*I, (18, 4) = .59467229263079952054+1.0300026246900120270*I, (19,
1) = 1.0, (19, 2) = 1.0, (19, 3) = .59165677643905044330+1.0247795974348560123*
I, (19, 4) = .59165677643905044333+1.0247795974348560123*I},datatype = anything
,storage = rectangular,order = Fortran_order,shape = [])

 

diff(abs(z), z)  returns abs(1, z)  and the latter, for a numeric z, is defined only for a nonzero real z.
However,  functions such as abs(I+sin(t)) are (real) differentiable for a real t and diff should work. It usually does, but not always.

restart
f:= t -> abs(GAMMA(2*t+I)):  # We want D(f)(1)
D(f)(1): 
evalf(%);  # Error, (in simpl/abs) abs is not differentiable at non-real arguments
D(f)(1); simplify(%); 
evalf(%);   # 0.3808979508 + 1.161104935*I,  wrong

The same wrong results are obtained with diff instead of D

diff(f(t),t):   # or  diff(f(t),t) assuming t::real; 
eval(%,t=1);
simplify(%); evalf(%);   # wrong, should be real

To obtain the correct result, we could use the definition of the derivative:

limit((f(t)-f(1))/(t-1), t=1); evalf(%); # OK 
fdiff(f(t), t=1);    # numeric, OK

   

       0.8772316598
       0.8772316599

Note that abs(1, GAMMA(2 + I)); returns 1; this is also wrong, it should produce an error because  GAMMA(2+I) is not real;
 

Let's redefine now `diff/abs`  and redo the computations.

restart
`diff/abs` := proc(u, z)   # implements d/dx |f(x+i*y|) when f is analytic and f(...)<>0
local u1:=diff(u,z);
1/abs(u)*( Re(u)*Re(u1) + Im(u)*Im(u1) )
end:
f:= t -> abs(GAMMA(2*t+I));
D(f)(1); evalf(%);   # OK now

               

         0.8772316597

Now diff works too.

diff(f(t),t);
eval(%,t=1);
simplify(%); evalf(%);   # it works

This is a probably a very old bug which may make diff(u,x)  fail for expressions having subespressions abs(...) depending on x.

However it works  using assuming x::real, but only if evalc simplifies u.
The problem is actually more serious because diff/ for Re, Im, conjugate should be revized too. Plus some other related things. 

I want to check whether the solution trial_sol satisfies the following PDE by Maple:

restart:
PDE:=diff(diff(u(x,y,t),x,y)/u(x,y,t),t$2)-diff(diff(u(x,y,t),x,y)/u(x,y,t),x$2)+2*diff((u(x,y,t)^2),x,t);
trial_sol:=(x,y,t)->sqrt(r)*tan((-t*v+x+c*y) *abs(sqrt(r)/(sqrt(2*c-2*c*(v^2)))))/(sqrt(2)*sqrt(v));
pdetest(u(x,y,t)=trial_sol(x,y,t),PDE);

 

Maple says the trial_sol is not a solution for PDE.

But Mathematica says that it is a solution. What is the problem?

 

I plotted the following tangent function with Maple and Mathematica for t=4. 

restart:
func:=unapply(-tan((-4*t+x+2*y)/(2*sqrt(15)))/(2*sqrt(2)),x,y,t);
plot3d(func(x,y,4),x=-15..15,y=-15..15);

Maple 3D plot:

Mathematica 3D plot:

 

I think that Maple shows the asymptotes. Is it possible to close the asymptotes?

Hi, 

I'm french and I'm working on an Imac.

The path for the desktop is  /Users/myname/Desktop.
If cur := "/Users/myname", one can easily verify this:

IsDirectory(cat(cur, "/Desktop"))
                              true

In some application I'm developping, I use a  FileDialog Maplet to select a directory where to write a file.
For an unknown reason this maplet doesn't display the desktop with the name Desktop, but with it's french counterpart Bureau.

# Observe thet the desktop (8th line above) is named "Desktop"
# Now run 

 maplet := Maplet(
      FileDialog['FD1'](
        'title' = "Output Directory", 
        'directory' = cur,
        'fileselectionmode' = directoriesonly, 
        'onapprove' = Shutdown(['FD1']), 
        'oncancel' = Shutdown()
      )
    ):

res := Maplets[Display](maplet):
StringTools:-StringSplit(res[], cur);

                        ["", "/Bureau"]


As a result, saving a file in cur/Bureau generates an error.
Here is a more detailed worksheet:
English_French_confusion.mw


Of course I have adjusted my code in an ad hoc way by french translating  what the maplet returns, but it is just a band-aid on a larger wound. For instance "Downloads" appears as "Téléchargements", and so on, and many names potentially need to be translated.

I do not understand why FileTools seems to "work in english" while  FileDialog seems to "work in french".
I suspect this is due to the fact that my Imac, although natively "English speaking", uses a French overlay. 
For instance the  Unix command pwd run in a terminal window indicates Users or Desktop, while  < command + i > executed on a given file displays Utilisateurs and Bureau.
Could it be that FileTools relies upon English, while FileDialog  relies upon the regionalized language?


What do you advice me:

  • to intervene at the Apple level by changing the "user" language my Imac uses, 
  • to intervene at the FileDialog  level (if possible),
  • or to keep translating undesired outcomes from FileDialog?
     

Thanks in advance

I need to treat Eqs. (1.85-1.86) as a system of equations that should be solved simultaneously, and use numerical solutions in Eqs. (1.87-1.90)
Do you know if there are in-built commands that can do this?

It's ok isolate command? I need the solution sin(a)=+-1/(3^0.5)

attach photo, i need simple step after 2.78 like book, solution is sin(a)=+-1/(3)^0.5.

Dear all

I try to understand why maple does ot plot the behavior of x^1/3 for negative real number, 

 

inverse_function_xthree.mw

 

root(x,3) is function defined verywhere, but why maple plot only this function for x positive 

thank you

The Putnam 2020 Competition (the 81st) was postponed to February 20, 2021 due to the COVID-19 pandemic, and held in an unofficial mode with no prizes or official results.

Four of the problems have surprisingly short Maple solutions.
Here they are.

A1.  How many positive integers N satisfy all of the following three conditions?
(i) N is divisible by 2020.
(ii) N has at most 2020 decimal digits.
(iii) The decimal digits of N are a string of consecutive ones followed by a string of consecutive zeros.

add(add(`if`( (10&^m-1)*10&^(n-m) mod 2020 = 0, 1, 0), 
n=m+1..2020), m=1..2020);

       508536

 

A2.  Let k be a nonnegative integer.  Evaluate  

sum(2^(k-j)*binomial(k+j,j), j=0..k);

        4^k

 

A3.  Let a(0) = π/2, and let a(n) = sin(a(n-1)) for n ≥ 1. 
Determine whether the series   converges.

asympt('rsolve'({a(n) = sin(a(n-1)),a(0)=Pi/2}, a(n)), n, 4);

            

a(n) ^2 being equivalent to 3/n,  the series diverges.

 

B1.  For a positive integer n, define d(n) to be the sum of the digits of n when written in binary
 (for example, d(13) = 1+1+0+1 = 3). 

Let   S =  
Determine S modulo 2020.

d := n -> add(convert(n, base,2)):
add( (-1)^d(k) * k^3, k=1..2020 ) mod 2020; 

        1990

 

First 307 308 309 310 311 312 313 Last Page 309 of 2097