MaplePrimes Questions

@ecterrab I have a related question. I define a hopping Hamiltonian H := sum(((Ket(e, n)) . (Bra(e, n + 1))) + ((Ket(e, n + 1)) . (Bra(e, n))), n = 1 .. d). Now I compute H.H. Maple is smart enough to write double sums with KroneckerDeltas but I don't manage to make it simplify them to single sums?

I have not found anything in the corresponding help page and mouse over does not work.

 

macOS 12.3 + Maple 2021.2

* --> Print
* --> Print to PDF

The created document essentially has no left border (margin). This has been a problem over at least the last three versions in Maple. I end up having to use an extra PDF cropping tool to reset the margins on the document.

What is the solution to this problem?

macOS 12.3 + Maple 2021.2

* select a region on a document
* context click
* --> Copy as image

Copy as image does not put an image on the clipboard.

What is solution?

Hi
One or two days ago, there was a question here by @nm about an integral that was resulting in an infinite loop. I don't know if this question was accidentally deleted, but I don't see it anymore.

The question was about the computation of 

> integrand := (a + b*(c*x^n)^(1/n))^p/x;
> int(integrated, x);

Indeed, there was a problem in the routines to derive assumptions, surfacing as the problem in int pointed out by @nm . Thanks to Austin Roche ( @aroche ) for his quick fix; the fix is distributed to everybody using Maple 2022 in the Maplesoft Physics Updates v.1184.

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

Dear all

` The aim of this code: to construct a non-abelian group of  odd order

such that the product of its elements not necessary identity element. 

symmetric_group.mw

But, the code doesn't display the elements. 

Thank you

I have tried a code in python for Francis QR algorithm but didn't desire the result. I don't know if it is possible to code in maple.

Given that A^0 = [[3.0, 1.0, 4.0], [1.0, 2.0, 2.0], [0., 13.0, 2]].

1. Write a little program that computes 1 step of Francis QR and test your program by starting from

A^0 = [[3.0, 1.0, 4.0], [1.0, 2.0, 2.0], [0., 13.0, 2]]  and compute A^1, A^2 ...A^6.

I expected to get:

A^0 = [[3.0, 1.0, 4.0], [1.0, 2.0, 2.0], [0., 13.0, 2]], 

A^1 = [[3.5,  -4.264, 0.2688], [-9.206, 1.577, 9.197], [0., -1.41, 1.923]], 

... A^6 = [[8.056,  1.596, 8.584], [0.3596, -2.01, -7.86], [0., 2.576*10^(-16), 0.9542]]. 

But didn't get the same results.

Here is my python code:

# Import packages
import numpy as np
from numpy.linalg import qr # QR from Linear Algebra Library
import scipy.linalg   # SciPy Linear Algebra Library
 

A = np.array([[3.0, 1.0, 4.0], [1.0, 2.0, 2.0], [0., 13.0, 2]])
p = [1, 2, 3, 4, 5, 6]
for i in range(30):
    q, r = qr(A)
    a = np.dot(r, q)
    if i+1 in p:
        print("Iteration {i+1}")
        print(A)

I would really appreciate your help.

Thank you.

I describe my problem accurately in mws file. I have a step function
 

First step. This is f(x) function

 

 

f := piecewise(-2 <= x and x < -1, 1, -1 <= x and x < 0, -1, 0 <= x and x < 1/2, 2, 1/2 <= x and x < 1, -2, 0)

piecewise(-2 <= x and x < -1, 1, -1 <= x and x < 0, -1, 0 <= x and x < 1/2, 2, 1/2 <= x and x < 1, -2, 0)

(1)

Next step. I try to approximate this function f(x) using wavelet transform, and  I  want to decomposite this function, choose wavelet Haar function and scaling functon  , choose basisn funtion from multiresolution analysis of the Lebesgue space  L^2(R). I choose  such wavelet fucntion `&varphi;`(x) from space MRA V0 and scaling function psi(x)from space MRA V0:NULL

`&varphi;__0` := piecewise(0 < x and x < 1/2, 1, 1/2 < x and x < 1, -1, 0)

piecewise(0 < x and x < 1/2, 1, 1/2 < x and x < 1, -1, 0)

(2)

`&psi;__0` := piecewise(0 < x and x < 1, 1, 0)

piecewise(0 < x and x < 1, 1, 0)

(3)

After I try approximate initial function f(x), decomposed using such contruction:

"f(x) =(&sum;) (&sum;)`C__m,k` `&varphi;__m,k`(x)  &approx;   f(x) =(&sum;)`C__i` `&varphi;__i` (x-k)"

"f(x) = (&sum;) (&sum;)`D__m,k` `psi__m,k`(x)    &approx;   f(x)=(&sum;)`D__i` `psi__i` (x-k)"

where coeff m shows, space MRA, to which the basis function belongs, and kk shows,basis function shift (x-k)

i.e. I try decompose function respective to basis function, where coeffs calculate the such way:

`C__m,k` = int(f(x)*`&varphi;__m,k`(x), x = -infinity .. infinity)

`D__m,k` = int(f(x)*`&psi;__m,k`(x), x = -infinity .. infinity)

The approximation is considered satisfactory if the following condition is  true:

sup = LinearAlgebra[Norm](f(x)-(sum(sum(`C__m,k`*`&varphi;__m,k`(x), k = 0 .. infinity), m = 0 .. infinity))) and LinearAlgebra[Norm](f(x)-(sum(sum(`C__m,k`*`&varphi;__m,k`(x), k = 0 .. infinity), m = 0 .. infinity))) <= .1

sup = LinearAlgebra[Norm](f(x)-(sum(sum(`D__m,k`*`&psi;__m,k`(x), k = 0 .. infinity), m = 0 .. infinity))) and LinearAlgebra[Norm](f(x)-(sum(sum(`D__m,k`*`&psi;__m,k`(x), k = 0 .. infinity), m = 0 .. infinity))) <= .1

For example `&varphi;__i` calculate that such way:

`&varphi;i` := proc (j, k, t) local a, b, c, m; m := 2^j; a := k/m; b := (k+1/2)/m; c := (k+1)/m; return piecewise(a <= t and t < b, 1, b <= t and t < c, -1) end proc

if `&varphi;__i`the wavelet Haar functions:

`&varphi;__i` := piecewise(a <= x and x < b, 1, b <= x and x < c, -1, 0)

piecewise(a <= x and x < b, 1, b <= x and x < c, -1, 0)

(4)

a = k/m, b = (k+.5)/m, c = (k+1)/m

Then vector of Haar functions compute using the follow code:

N := 2^J; `&varphi;d` := Vector(N); H := Matrix(N, N); T := Vector(N); `&varphi;d`[1] := `&varphi;1`(t); for i to N do T[i] := (i-1/2)/N end do; for j from 0 to J-1 do m := 2^j; for k from 0 to m-1 do i := m+k+1; `&varphi;d`[i] := `&varphi;i`(j, k, t) end do end do; for i to N do for j to N do H[i, j] := eval(`&varphi;d`[i], t = T[j]) end do end do

``

Then integrals

`&approx;`(int(`&varphi;__m,k`(x), x = -infinity .. infinity), `p__d,1`(x)) and `p__d,1`(x) = int(`&varphi;__d`(x), x = 0 .. x) and `&approx;`(int(`&varphi;__d`(x), x = 0 .. x), `P__d `*`&Phi;__d`)

`&approx;`(int(`&psi;__m,k`(x), x = -infinity .. infinity), `p__d,1`(x)) and `p__d,1`(x) = int(`&psi;__d`(x), x = 0 .. x) and `&approx;`(int(`&psi;__d`(x), x = 0 .. x), `P__d `*`&Psi;__d`)

where `P__d ` is an d-square matrix called an operational matrix of integration

pn := proc (i, n, t) if n = 1 then return int(`&varphi;d`[i], t) end if; return int(pn(i, n-1, t)) end proc

NULL

And now, it's not working, so I have troubles for calculate coeffs and writing and  plotting this result, so, I have some questions:

1) How to calculate coeffs `C__m,k`and `D__m,k`  for my fucntion f(x) and get value of coeffs?
2) How to implement integration and write the final sum (approximation of function f(x)?

3) How to calculate  

LinearAlgebra[Norm](f(x)-(sum(sum(`C__m,k`*`&varphi;__m,k`(x), k = 0 .. infinity), m = 0 .. infinity)))

LinearAlgebra[Norm](f(x)-(sum(sum(`D__m,k`*`&psi;__m,k`(x), k = 0 .. infinity), m = 0 .. infinity)))

and plot initial function f(x) and approximation sum at one plot?
 

Do I understand correctly that I need to calculate this integral for my function on each interval of my function?

int(`&varphi;__m,k`(x), x = -2 .. -1); int(`&varphi;__m,k`(x), x = -1 .. 0); int(`&varphi;__m,k`(x), x = 0 .. 1/2); int(`&varphi;__m,k`(x), x = 1/2 .. 1)

int(`&psi;__m,k`(x), x = -2 .. -1); int(`&psi;__m,k`(x), x = -1 .. 0); int(`&psi;__m,k`(x), x = 0 .. 1/2); int(`&psi;__m,k`(x), x = 1/2 .. 1)

How to implement this procedure?


Code for calculating procs a I try ude from this source: http://www.m-hikari.com/ams/ams-2012/ams-125-128-2012/sunmonuAMS125-128-2012.pdf

Download LR1.mw

I would be very grateful for any help!

Electric circuit problem.
How to solve this four resistors circuit by Syrup? ... EDIT; This is not my electric circuit problem. My exercise how to use Maple. Below is the problem.

This electric circuit problem is very hard to solve. Maple or other math program must need to solve.

How to make one ohm by using one-ohm resistors while each resistor must flow different current.

Using 1 A current source, node 1 shows 1 V.

The electric circuit below shows 1 ohm, however, the current of each resistor is same.

So, this is not the answer.

NULL

restart; with(Syrup); ckt := [-Iin(1), `&//`(R1(1), R2(1)), `&//`(R3(1), R4(1))]; Draw(ckt)

 

NULL

Download Make_one_ohm_by_one_ohm.mw

Hello,

In the code below I would expect the a-bar to be replaced in, just like the b below it. Is there something i'm missing here? I applied the bar using the Maple accent palette.

I knew it can't be true that timelimit in Maple 2022 no longer hangs and it is only a matter of time before I find a case where it still hangs.

Here are examples. timelimit hangs. No error or anything, it just hangs. timelimit is just ignored. set the limit to 60 seconds  (CPU time), and waited for 20 minutes (real time) and nothing happend.

I hope in Maple 2023 this will be fixed. Could others confirm this? it only hangs when adding the method=_RETURNVERBOSE otherwise it does not hang.

interface(version);

`Standard Worksheet Interface, Maple 2022.0, Windows 10, March 8 2022 Build ID 1599809`

Examples of timelimit hangs in Maple 2022

 

Example 1

restart;

integrand:=(B*x+A)/(c*x^2+b*x+a)^2/(f*x^2+e*x+d)

try
  timelimit(60,int(integrand,x,method=_RETURNVERBOSE));
catch:
  print("Timed out");
end try;

 

Example 2

restart

integrand:=(5*x^4-x^3+3*x^2+x+2)*(2*x^2-x+3)^(1/2)/(5+2*x)^3

try
    timelimit(60,int(integrand,x,method = _RETURNVERBOSE));
catch:
  print("Timed out");
end try;

 

 

Download int_hangs.mw

This is a serious problem.

I change "how should maple handle the creation of new math engine?" to "Create new engine for each document". Then click on "Apply globally".  This is under Tools->Options->General

After I close Maple and start it again, I found it back to "Share one engine among all documents" ??

Why is that and how to make this permanent? 

Btw, the start Maple 2022 icon still says "Maple 2022 shared server". THis is in the start program menu. I complained about this in Maple 2021 but it is still not fixed.  https://www.mapleprimes.com/questions/231901-Why-Maple-2021-Only-Shows-shared-Server

I do not think this has anything to do with it. But who knows.

I noticed this when I started new worksheet and could not do anything in it because another worksheet was running something even though I made sure I had set the engine to start new one for each worksheet (this is the very first thing I do after I install Maple each time).

Any workaround to make the setting for the engine not change after closing Maple?

Windows 10. Maple 2022.

This was very surprising!!

x:=3;
                               3
g:=x;h:=x^2;
                               3
                               9
subs(x=4,g);subs(x=4,h);
                               4
                               9

This is inconsistent! After g and h have been assigned values, they do not depend on x anymore, so g should not be turned into 4 by subs

First 208 209 210 211 212 213 214 Last Page 210 of 2308