Alex0099

45 Reputation

4 Badges

3 years, 111 days

MaplePrimes Activity


These are questions asked by Alex0099

Dear members of the forum, please tell me if it is possible to calculate the series presented below by Maple 2022. As far as I understand, first you need to calculate the inner and then the outer sum, but I don’t know how to do this with the help of the program, this series does not converge, as it seems to me, but I can be wrong, if the series diverges, then I need to show it.

Sorry for my ignorance, but maybe I wrong apply such commands for calculation this sums:

Sum(F, a = 1 .. infinity, b = 1 .. infinity) = DefiniteSummation(F, a = 1 .. infinity, b = 1 .. infinity)

I understand, that Sum () not be able to recive more than one args, but I don't understand how to make this calculation...

Any idea? Thanks for advices and help!

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!

Hello, dear members! I try to solve the 1-D Wave Equation with initial and boundary conditions. And I have a problem when I'm trying to find the coeffs of Fourier series, that they depend on initial conditions. This is my code for Maple:
 

restart;
with(PDETools);

# set the PDE, ic(initial conds) and bc (boundary conds)
pde := diff(u(x, t), t, t) = a^2*diff(u(x, t), x, x);
ic := u(x, 0) = 0, D[2](u)(x, 0) = psi(x);
bc := u(0, t) = 0, u(l, t) = 0;
psi := piecewise(0 <= x and x <= l/2, x, l/2 <= x and x <= l, l - x);

# using Fourier method for solving (I require use this methods)
res := pdsolve(pde, HINT = T(t)*X(x));

ode1 := op(1, op(1, op(2, res)));

ode2 := op(2, op(1, op(2, res)));               

ode2 := subs(_c[1] = -lambda, ode2);
              

# solve 2 ODE
# equation rely X(x)
dsolve({ode2, X(0) = 0}, X(x));

sin(sqrt(lambda)*l) = 0;

solve(%, lambda, allsolutions);

lambda := (Pi*n/l)^2;

X := (x, n) -> sin(Pi*n*x/l);


# equation rely T(t)
ode1 := subs(_c[1] = -lambda, ode1);

dsolve({%, T(0) = 0}, T(t));

T := (t, n) -> C1[n]*sin(Pi*n*a*t/l);

# write the general solutions
Un := (x, t, n) -> T(t, n)*X(x, n);

# find the coeffs series
simplify(subs(t = 0, diff(u(x, t), t)) = psi);

((2/l)*l/(Pi*n*a)*int(psi*X(x, n), x = 0 .. l) assuming (x < l))
simplify(%) assuming n::posint;
combine(%);
C1[n] := factor(%)

But I got it:



How to find this C1 coefficient and solve this equation? Maple doesn't work now. This command does not give the result.
I attached mws files, so pdeLR_11.mw is another code for solving, but it is not working so((! 

Maybe I use this command wrong, or step-function is not convenient for maple?

Any helpful advice would be very cool. I am grateful in advance!

https://drive.google.com/file/d/1VznAvxcpF3ME9MMBjfKKifsbrbOb9uSY/view?usp=sharing

https://drive.google.com/file/d/15D7BCRwHliYb2OseH81i81RjQP7NRFgS/view?usp=sharing

 

Page 1 of 1