## 230 Reputation

10 years, 231 days
Beijing, China

## Value of an expression at specific posit...

Maple 2015

Dear Users!

Hope you would be fine with everything. I want to evaluate an expression (diff(u(y, t), y)+diff(diff(u(y, t), y), t)) for various values of b at y = 0, t=1. Please help me to evaluate it. Thanks in advance,

restart; with(plots); a := .7; L := 8; HAA := [0, 2, 5, 10];

for i to nops(HAA) do

b := op(i, HAA);

PDE1[i] := diff(u(y, t), t) = diff(u(y, t), y, y)+diff(diff(u(y, t), y, y), t)-b*u(y, t)+T(y, t);

PDE2[i] := diff(T(y, t), t) = (1+(1+(a-1)*T(y, t))^3)*(diff(T(y, t), y, y))+(a-1)*(1+(a-1)*T(y, t))^2*(diff(T(y, t), y))^2+T(y, t)*(diff(T(y, t), y, y))+(diff(T(y, t), y))^2;

ICandBC[i] := {T(L, t) = 0, T(y, 0) = 0, u(0, t) = t, u(L, t) = 0, u(y, 0) = 0, (D[1](T))(0, t) = -1};

PDE[i] := {PDE1[i], PDE2[i]}; pds[i] := pdsolve(PDE[i], ICandBC[i], numeric)

end do;

## PDEs solve numerically...

Maple 15

Dear Users! I solved a PDE by using the following code.
restart;a := 1:b:= 2:l:= 1:alpha[1]:= 1:alpha[2]:= 3:
syspde:= [diff(u(x, t), t)-a+u(x, t)-u(x, t)^2*v(x, t)-alpha[1]*(diff(u(x, t), x\$2)) = 0, diff(v(x, t), t)-b+u(x, t)^2*v(x, t)-alpha[2]*(diff(v(x, t), x\$2)) = 0];
Bcs:= [u(x,0)=1,v(x,0)=1,D[1](u)(-l, t) = 0,D[1](u)(l, t) = 0,D[1](v)(-l, t) = 0,D[1](v)(l, t) = 0];
sol:=pdsolve(syspde, Bcs, numeric);
p1:=sol:-plot3d( u(x,t), t=0..1, x=-1..1, color=red);
p2:=sol:-plot3d( v(x,t), t=0..1, x=-1..1, color=blue);
Now I want to see the value of u(x, t)+diff(u(x, t), x)+diff(u(x, t), t) when x=0 and t=1. Please help me to fix the problem. Thanks in advance.

## Spliting of a matrix ...

Maple 2015

Dear Users!

Hope you would be fine with everything. I have following code to generate marix A of order M by M

restart; with(LinearAlgebra); with(linalg); Digits := 30; M := 10; nu := 1;

for k1 while k1 <= M do

C[k1] := simplify(sum((-1)^(k1-1-i1)*GAMMA(k1-1+i1+2*nu)*GAMMA(nu+1/2)*x^i1/(GAMMA(i1+nu+1/2)*factorial(k1-1-i1)*factorial(i1)*GAMMA(2*nu)), i1 = 0 .. k1-1))

end do;

A := evalm(Matrix(M, M, proc (i, j) options operator, arrow; eval(C[j], x = (i-1)/(M-1)) end proc))

I want to split (or decompose) A into two parts Ad and Ab

A = Ab + Ad

where Ad is M by M matrix of all entries of A but first and last rows of Ad shoud be zero

and Ab is M by M matrix with zero entries expect first and last rows.

For exmaple for M = 5, A, Ab and Ad are given as,

Ab := Matrix(5, 5, {(1, 1) = 1, (1, 2) = -2, (1, 3) = 3, (1, 4) = -4, (1, 5) = 5, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (5, 1) = 1, (5, 2) = 2, (5, 3) = 3, (5, 4) = 4, (5, 5) = 5});

Ad := Matrix(5, 5, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 1, (2, 2) = -1, (2, 3) = 0, (2, 4) = 1, (2, 5) = -1, (3, 1) = 1, (3, 2) = 0, (3, 3) = -1, (3, 4) = 0, (3, 5) = 1, (4, 1) = 1, (4, 2) = 1, (4, 3) = 0, (4, 4) = -1, (4, 5) = -1, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0});

Special request @acer @Carl Love @Kitonum @Preben Alsholm

## Collocating a vector...

Maple 2015

Hi User!

Hope you would be fine with everything. I have a vector "POL" of M dimension obatined for the following expression

restart; with(LinearAlgebra); nu := 1; M := 3;
for k while k <= M do
Poly[k] := simplify(sum(x^i*GAMMA(nu+1)/(factorial(i)*GAMMA(2*nu)), i = 0 .. k-1))
end do;
POL := `<,>`(seq(Poly[k], k = 1 .. M))

and I want to construct a matrix of M by M by collocating it on the points x=i/(M-1) for i=0,1,2,...,M-1 like the following way,

For M=3 I need

Matrix(3, 3, {(1, 1) = Poly[1](0), (1, 2) = Poly[1](1/2), (1, 3) = Poly[1](1), (2, 1) = Poly[2](0), (2, 2) = Poly[2](1/2), (2, 3) = Poly[2](1), (3, 1) = Poly[3](0), (3, 2) = Poly[3](1/2), (3, 3) = Poly[3](1)});

For M=4 I need

Matrix(4, 4, {(1, 1) = Poly[1](0), (1, 2) = Poly[1](1/3), (1, 3) = Poly[1](2/3), (1, 4) = Poly[1](1), (2, 1) = Poly[2](0), (2, 2) = Poly[2](1/3), (2, 3) = Poly[2](2/3), (2, 4) = Poly[2](1), (3, 1) = Poly[3](0), (3, 2) = Poly[3](1/3), (3, 3) = Poly[3](2/3), (3, 4) = Poly[3](1), (4, 1) = Poly[4](0), (4, 2) = Poly[4](1/3), (4, 3) = Poly[4](2/3), (4, 4) = Poly[4](1)})

and general form is like this

[[[Poly[1](0/(M-1)),Poly[1](1/(M-1)),Poly[1]((2)/(M-2)),...,Poly[1]((M-1)/(M-1))],[Poly[2](0/(M-1)),Poly[2]((1)/(M-1)),Poly[2]((2)/(M-1)),...,Poly[2]((M-1)/(M-1))],[Poly[3]((0)/(M-1)),Poly[3]((1)/(M-1)),Poly[3]((2)/(M-1)),...,Poly[3]((M-1)/(M-1))],[...,...,...,...,...],[Poly[M]((0)/(M-1)),Poly[M]((1)/(M-1)),Poly[M]((2)/(M-1)),...,Poly[M]((M-1)/(M-1))]]];

Another problem is I want to define a vector of M dimension using a function f(x)=sin(x) and two points a=1, b=2 like the following way,

Vec:=[[[a],[f((1)/(M-1))],[f((2)/(M-1))],[f((3)/(M-1))],[...],[f((M-1)/(M-1))],[b]]]
Please fix my problem. I'm waiting for your kind response.
Special request @acer @acer @Carl Love @Kitonum @Preben Alsholm

## Simplification of an expression...

Maple 2015

Dear Users!

Hope you would be fine with everything. I want the simpliest for of the following expression in two step:

diff(U(X, Y, Z, tau), tau)+U(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), X))+V(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), Y))+W(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), Z))+u[delta]*lambda[1]*(diff(U(X, Y, Z, tau), tau, tau))/L[delta]+u[delta]*lambda[1]*(diff(U(X, Y, Z, tau), tau))*(diff(U(X, Y, Z, tau), X))/L[delta]+u[delta]*lambda[1]*U(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), tau, X))/L[delta]+u[delta]*lambda[1]*(diff(V(X, Y, Z, tau), tau))*(diff(U(X, Y, Z, tau), Y))/L[delta]+u[delta]*lambda[1]*V(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), tau, Y))/L[delta]+u[delta]*lambda[1]*(diff(W(X, Y, Z, tau), tau))*(diff(U(X, Y, Z, tau), Z))/L[delta]+u[delta]*lambda[1]*W(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), tau, Z))/L[delta];
Step 1:
diff(U(X, Y, Z, tau), tau)+U(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), X))+V(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), Y))+W(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), Z))+u[delta]*lambda[1]*(diff(diff(U(X, Y, Z, tau), tau)+U(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), X))+V(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), Y))+W(X, Y, Z, tau)*(diff(U(X, Y, Z, tau), Z)), tau))/L[delta];
Step 2: (final form I need)
(1+(u[delta] lambda[1])/(L[delta]) (&PartialD;)/(&PartialD;tau)) ((&PartialD;)/(&PartialD;tau) U(X,Y,Z,tau)+U(X,Y,Z,tau) ((&PartialD;)/(&PartialD;X) U(X,Y,Z,tau))+V(X,Y,Z,tau) ((&PartialD;)/(&PartialD;Y) U(X,Y,Z,tau))+W(X,Y,Z,tau) ((&PartialD;)/(&PartialD;Z) U(X,Y,Z,tau)));
I'm waiting for your response.
Special request:
@acer @Carl Love @Kitonum @Preben Alsholm

 First 6 7 8 9 10 11 12 Last Page 8 of 37
﻿