Maple 2015 Questions and Posts

These are Posts and Questions associated with the product, 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});

Please help me to fix this problem.
Special request @acer @Carl Love @Kitonum @Preben Alsholm

Hi,

How can I force the command InsertContent(Worksheet(Group(Input( T )))) to display the variable eq as it appears in label (2) ?

(a screen capture of the output of InsertContent(Worksheet(Group(Input( T )))) is given after the Maple code)

restart:

interface(version)

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

with(DocumentTools):

with(DocumentTools[Layout]):

eq := piecewise(t < 1, sin(t), cos(t));

C := Cell( Textfield(style=TwoDimOutput,Equation(eq)) ):
T := Table(Column(), widthmode=percentage, width=40, Row(C)):
InsertContent(Worksheet(Group(Input( T )))):

eq := piecewise(t < 1, sin(t), cos(t))

(2)

 



Download Layout.mw

Hi!

There is a (relatively) known software code (written in C), called ." GKLS-generator" or "GKLS" to generate, according to certain user paramenters, optimization test functions. The code is available for free at the web

http://wwwinfo.deis.unical.it/%7Eyaro/GKLS.html

The download with the files of the GKLS is the following:  download

I would like to write this code in Maple. In the attached zip there is a PDF explaining how to build these functions. For now, I tried the follwoing Maple code GKLS_v4.mw

I think I'm doing something wrong, since the drawing generated by the attached Maple does not look much like the PDF in the attached zip (Fig. 1 of page 8).

Please, Can you help me with this?

Many thanks in advance for your comments.

 

 

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

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

Hi

I would like to use  the Liebniz notation that someone from the technical support posted here
Writing Derivatives at a Point Using Leibniz Notation
to display a formula that is not just a partial derivative but a more complex expression invoking partial derivatives. 
Typically an expression like this one:

2*(Diff(f(mu__1, mu__2), mu__1))^2*lambda__1^2-(Diff(f(mu__1, mu__2), mu__1))^2*mu__1^2+2*(Diff(f(mu__1, mu__2), mu__2))^2*lambda__2^2-(Diff(f(mu__1, mu__2), mu__2))^2*mu__2^2+2*(Diff(f(mu__1, mu__2), mu__1))*(Diff(f(mu__1, mu__2), mu__2))*lambda__1*lambda__2-2*(Diff(f(mu__1, mu__2), mu__1))*mu__1*(Diff(f(mu__1, mu__2), mu__2))*mu__2

Could anyone help me to do this?
Thanks in advance

(PS: I'm still using Maple 2015.2)

Dear Users!

Hoped everything going fine with you. I want to make animation of ten solutions as given bellow but fail to do that. Please see it fix the problem. I shall be very thankful to u.
SOLNSuy[1, 1] := 2.5872902469406659197*10^(-20)-.65694549571241255901*y+1.9708364871372376767*y^2-1.3138909914248251176*y^3-1.6010739356637904911*10^(-19)*y^4;
SOLNSuy[2, 1] := -4.002204462000*10^(-20)-1.7879176897079605225*y+5.3637530691192141414*y^2-3.5758353794044226250*y^3-6.8309939211286845440*10^(-12)*y^4;
SOLNSuy[3, 1] := -1.1953264450000*10^(-19)-3.2481690589079594122*y+9.7445071767154794599*y^2-6.4963381177952273213*y^3-1.2292726248071398400*10^(-11)*y^4;
SOLNSuy[4, 1] := -2.6720465500000*10^(-19)-4.9239979672954025921*y+14.771993901873204315*y^2-9.8479959345587718955*y^3-1.9029826928878336000*10^(-11)*y^4;
SOLNSuy[5, 1] := 3.416928541000*10^(-20)-6.7268498492441931137*y+20.180549547714413714*y^2-13.453699698443639810*y^3-2.6580790570532587008*10^(-11)*y^4;
SOLNSuy[6, 1] := -2.554122292000*10^(-20)-8.5884528335125514887*y+25.765358500514014457*y^2-17.176905666966875698*y^3-3.4587270427710613504*10^(-11)*y^4;
SOLNSuy[7, 1] := -9.206107680000*10^(-20)-10.456823708331499352*y+31.370471124965259849*y^2-20.913647416590986491*y^3-4.2774005353527132160*10^(-11)*y^4;
SOLNSuy[8, 1] := 1.9644186790000*10^(-19)-12.293003938471349390*y+36.879011815379230436*y^2-24.586007876856948223*y^3-5.0932823222176363520*10^(-11)*y^4;
SOLNSuy[9, 1] := -3.775112769000*10^(-19)-14.068404975282556550*y+42.205214925807397100*y^2-28.136809950465931724*y^3-5.8908824448577377280*10^(-11)*y^4;
SOLNSuy[10, 1] := 1.146281780000*10^(-19)-15.762658869974768890*y+47.287976609878780960*y^2-31.525317739837422477*y^3-6.6589592851037286400*10^(-11)*y^4;
plots[animate](plot, [SOLNSuy[A, 1], y = 0 .. 1], A = 1 .. 10);

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

Here is a little animation to wish all of you a Merry Christmas

FireWorks.mw


Hi, 

 

In help page DocumentTools:-Layout:-Font, there is an example which shows how to inser a hyperlink in a Layout.

F := Font( "Some text", size=16, color=blue, style=:-Hyperlink ):
InsertContent(Worksheet(Group(Input(Textfield( F ))))):

 

When this id done, how can we activate this hyperlink ?
5I'm presently working with Maple 2015.2 under Mac OS Mojave)

Thanks in advance

 

Hi, 

Moving the sliders clean the plot.
Does any one can show me how to fix this (PS: this piece of code is a part of a procedure whose arguments are RV and SliderRanges and I need this unusual coding to make the procedure generic ... at least I guess so)

Thanks in advance


 

restart:

interface(version);

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

with(Statistics):

RV   := RandomVariable(Normal(a, b)):
law  := [attributes(RV)][3]:
pars := law:-Parameters;

[a, b]

(2)

SliderRanges := [-5.0..5.0, 1.0..3.0]:
[seq(pars[k]=SliderRanges[k], k=1..numelems(pars))]

[a = -5.0 .. 5.0, b = 1.0 .. 3.0]

(3)

f := PDF(RV, x);
# Explore(plot(f, x=-3..3), parameters=[seq(pars[k]=SliderRanges[k], k=1..numelems(pars))]);

(1/2)*2^(1/2)*exp(-(1/2)*(x-a)^2/b^2)/(Pi^(1/2)*b)

(4)

 


 

Download Explore_Problem.mw

Hi,

Why extracting the features of the events doesn't return the good results when executed within a loop (see the pink test) ?

Thanks in advance.

PS: please, spare me  replies of the type "you can solve this equation formally"

 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

sys := { diff(x(t), t) = 1, x(0) = 0 }:
evs := [ [x(t)-0.1, none],  [x(t)-0.3, none], [x(t)-0.5, none] ]:
sol := dsolve(sys, numeric, events=evs):

plots:-odeplot(sol, [t, x(t)], t=0..0.5, gridlines=true);

 

# times that fired the events

sol(1): # initialization

sol(eventfired=[1]);
sol(eventfired=[2]);
sol(eventfired=[3]);
 

[HFloat(0.1)]

 

[HFloat(0.3)]

 

[HFloat(0.49999999999999994)]

(2)

# Same times computed  within a loop

for i from 1 to 3 do
  te := op(sol(eventfired=[i]));
end do;

HFloat(0.1)

 

HFloat(0.3)

 

HFloat(0.49999999999999994)

(3)

# Values of x(t) computed  within a loop
#
# Why are calues for events 2 and 3 wrong ?
for i from 1 to 3 do
  te := op(sol(eventfired=[i]));
# xe := sol(te);             # this doesn't return the correct result,
# xe := subs(sol(te), x(t)); # this doesn't work neither
  xe := eval(x(t), sol(te)); # this doesn't work neither
end do;

HFloat(0.1)

 

HFloat(0.1)

 

HFloat(0.0)

 

HFloat(0.0)

 

HFloat(0.0)

 

HFloat(0.0)

(4)

 


 

Download Incomprehensible.mw

 

I would like to plot a hyperbola using the polarplot command, such as the following:

polarplot(3/(1-1.5*sin(theta)), coordinateview = [0 .. 10, 0 .. 2*Pi])

But the graph includes the asymptotes, which I would not like to be included. I have tried the discont=true command, but it completely changes the shape of the graph and no longer looks like a hyperbola:

polarplot(3/(1-1.5*sin(theta)), coordinateview = [0 .. 10, 0 .. 2*Pi], discont = true)

 How would I get the hyperbola above to display with no asymptotes?

Thanks

is there any library or tools to design index of Grassmannian and its k and n for Schubert use?

is there any library to relate poset with index of Grassmannian and its k and n for Schubert use

hello everyone,
   INGT.mw
 

L__d := 100:

L__b := 200:

L__c := L__d+(1/2)*L__b;

200

(1)

X := .3;

.3

(2)

Error, (in plot) procedure expected, as range contains no plotting variable

 

`&Delta;E__g` := 1.155*X+.37*X^2;

.3798

(3)

V__0 := .6*`&Delta;E__g`;

.22788

(4)

m__D := 0.67e-1*m[e];

0.67e-1*m[e]

(5)

m__B := (0.67e-1+0.83e-1*X)*m[e];

0.919e-1*m[e]

(6)

Sol := solve(2*cos(L__d*sqrt(E__x))+(m__D*sqrt((V__0-E__x)/E__x)/m__B-m__B*sqrt(E__x/(V__0-E__x))/m__D)*sin(L__d*sqrt(E__x))-(m__D*sqrt((V__0-E__x)/E__x)/m__B+m__B*sqrt(E__x/(V__0-E__x))/m__D)*sin(L__d*sqrt(E__x))*exp(-sqrt(V__0-E__x)*L__b) = 0, E__x);

0.1110897170e-2, 0.3531161505e-2, -.2585338615+0.9991335677e-27*I

(7)

 

0.1110897170e-2, 0.3531161505e-2, -.2585338615+0.9991335677e-27*I

(8)

E__1 := 0.1110897170e-2:

K__1 := sqrt(E__1);

0.3333012406e-1

(9)

K__2 := sqrt(V__0-E__1);

.4762027959

(10)

C := cosh((1/2)*K__2*L__b);

0.2399908351e21

(11)

beta := m__D*K__2/(m__B*K__1);

10.41631973

(12)

B := -beta*sinh((1/2)*K__2*L__b);

-0.2499821271e22

(13)

A := -B*sin(K__1*L__d)+C*cos(K__1*L__d);

-0.7112056933e21

(14)

h := proc (x) options operator, arrow; piecewise(x <= -L__c, A*exp(K__2*(x+L__c)), -L__c < x and x < -(1/2)*L__b, -B*sin(K__1*(x+(1/2)*L__b))+C*cos(K__1*(x+(1/2)*L__b)), abs(x) <= (1/2)*L__b, (1/2)*exp(K__2*x)+(1/2)*exp(-K__2*x), (1/2)*L__b < x and x < L__c, -B*sin(K__1*(x-(1/2)*L__b))+C*cos(K__1*(x-(1/2)*L__b)), L__c <= x, A*exp(K__2*(x-L__c))) end proc:

'h(x)' = h(x);

h(x) = piecewise(x <= -200, -7.112056933*10^20*exp(95.24055918+.4762027959*x), -200 < x and x < -100, 2.499821271*10^21*sin(3.333012406+0.3333012406e-1*x)+2.399908351*10^20*cos(3.333012406+0.3333012406e-1*x), abs(x) <= 100, (1/2)*exp(.4762027959*x)+(1/2)*exp(-.4762027959*x), 100 < x and x < 200, 2.499821271*10^21*sin(0.3333012406e-1*x-3.333012406)+2.399908351*10^20*cos(0.3333012406e-1*x-3.333012406), 200 <= x, -7.112056933*10^20*exp(-95.24055918+.4762027959*x))

(15)

L__y := 200:

L__z := 200:

P := proc (x, y, z) options operator, arrow; h(x)*cos(Pi*y/L__y)*cos(Pi*z/L__z) end proc:

'Psi(x, y, z)' = P(x, y, z);

Psi(x, y, z) = piecewise(x <= -200, -7.112056933*10^20*exp(95.24055918+.4762027959*x), -200 < x and x < -100, 2.499821271*10^21*sin(3.333012406+0.3333012406e-1*x)+2.399908351*10^20*cos(3.333012406+0.3333012406e-1*x), abs(x) <= 100, (1/2)*exp(.4762027959*x)+(1/2)*exp(-.4762027959*x), 100 < x and x < 200, 2.499821271*10^21*sin(0.3333012406e-1*x-3.333012406)+2.399908351*10^20*cos(0.3333012406e-1*x-3.333012406), 200 <= x, -7.112056933*10^20*exp(-95.24055918+.4762027959*x))*cos((1/200)*Pi*y)*cos((1/200)*Pi*z)

(16)

INGT := proc (x__i) `assuming`([evalf(int(int(int(P(x, y, z)^2*exp(-lambda*sqrt((x-x__i)^2+y^2+z^2)), x = -infinity .. infinity), y = -L__y .. L__y), z = -L__z .. L__z))], [0 < lambda]) end proc

evalf(INGT(2))

``

Warning,  computation interrupted

 

``


 

Download INGT.mw
 

L__d := 100:

L__b := 200:

L__c := L__d+(1/2)*L__b;

200

(1)

X := .3;

.3

(2)

Error, (in plot) procedure expected, as range contains no plotting variable

 

`&Delta;E__g` := 1.155*X+.37*X^2;

.3798

(3)

V__0 := .6*`&Delta;E__g`;

.22788

(4)

m__D := 0.67e-1*m[e];

0.67e-1*m[e]

(5)

m__B := (0.67e-1+0.83e-1*X)*m[e];

0.919e-1*m[e]

(6)

Sol := solve(2*cos(L__d*sqrt(E__x))+(m__D*sqrt((V__0-E__x)/E__x)/m__B-m__B*sqrt(E__x/(V__0-E__x))/m__D)*sin(L__d*sqrt(E__x))-(m__D*sqrt((V__0-E__x)/E__x)/m__B+m__B*sqrt(E__x/(V__0-E__x))/m__D)*sin(L__d*sqrt(E__x))*exp(-sqrt(V__0-E__x)*L__b) = 0, E__x);

0.1110897170e-2, 0.3531161505e-2, -.2585338615+0.9991335677e-27*I

(7)

 

0.1110897170e-2, 0.3531161505e-2, -.2585338615+0.9991335677e-27*I

(8)

E__1 := 0.1110897170e-2:

K__1 := sqrt(E__1);

0.3333012406e-1

(9)

K__2 := sqrt(V__0-E__1);

.4762027959

(10)

C := cosh((1/2)*K__2*L__b);

0.2399908351e21

(11)

beta := m__D*K__2/(m__B*K__1);

10.41631973

(12)

B := -beta*sinh((1/2)*K__2*L__b);

-0.2499821271e22

(13)

A := -B*sin(K__1*L__d)+C*cos(K__1*L__d);

-0.7112056933e21

(14)

h := proc (x) options operator, arrow; piecewise(x <= -L__c, A*exp(K__2*(x+L__c)), -L__c < x and x < -(1/2)*L__b, -B*sin(K__1*(x+(1/2)*L__b))+C*cos(K__1*(x+(1/2)*L__b)), abs(x) <= (1/2)*L__b, (1/2)*exp(K__2*x)+(1/2)*exp(-K__2*x), (1/2)*L__b < x and x < L__c, -B*sin(K__1*(x-(1/2)*L__b))+C*cos(K__1*(x-(1/2)*L__b)), L__c <= x, A*exp(K__2*(x-L__c))) end proc:

'h(x)' = h(x);

h(x) = piecewise(x <= -200, -7.112056933*10^20*exp(95.24055918+.4762027959*x), -200 < x and x < -100, 2.499821271*10^21*sin(3.333012406+0.3333012406e-1*x)+2.399908351*10^20*cos(3.333012406+0.3333012406e-1*x), abs(x) <= 100, (1/2)*exp(.4762027959*x)+(1/2)*exp(-.4762027959*x), 100 < x and x < 200, 2.499821271*10^21*sin(0.3333012406e-1*x-3.333012406)+2.399908351*10^20*cos(0.3333012406e-1*x-3.333012406), 200 <= x, -7.112056933*10^20*exp(-95.24055918+.4762027959*x))

(15)

L__y := 200:

L__z := 200:

P := proc (x, y, z) options operator, arrow; h(x)*cos(Pi*y/L__y)*cos(Pi*z/L__z) end proc:

'Psi(x, y, z)' = P(x, y, z);

Psi(x, y, z) = piecewise(x <= -200, -7.112056933*10^20*exp(95.24055918+.4762027959*x), -200 < x and x < -100, 2.499821271*10^21*sin(3.333012406+0.3333012406e-1*x)+2.399908351*10^20*cos(3.333012406+0.3333012406e-1*x), abs(x) <= 100, (1/2)*exp(.4762027959*x)+(1/2)*exp(-.4762027959*x), 100 < x and x < 200, 2.499821271*10^21*sin(0.3333012406e-1*x-3.333012406)+2.399908351*10^20*cos(0.3333012406e-1*x-3.333012406), 200 <= x, -7.112056933*10^20*exp(-95.24055918+.4762027959*x))*cos((1/200)*Pi*y)*cos((1/200)*Pi*z)

(16)

INGT := proc (x__i) `assuming`([evalf(int(int(int(P(x, y, z)^2*exp(-lambda*sqrt((x-x__i)^2+y^2+z^2)), x = -infinity .. infinity), y = -L__y .. L__y), z = -L__z .. L__z))], [0 < lambda]) end proc

evalf(INGT(2))

``

Warning,  computation interrupted

 

``


 

Download INGT.mw

 

I'm trying to calculate a triple integral complicated by a procedure that changes each time a variable xi, while the program takes a lot of time and it gives me the message "Warning, computation interrupted". If anyone can help me I will be very happy

Hi,

Sorry to ask such a stupid question but I can't find out where my error is. Probably it's so huge it blinds me!

The double loop and the matrix product F^+ . F should give the same result, no? (it seems that F^+ . F has its rows reordered ?)


 

restart:

N   := 3:
P   := 2:
niv := [seq(Z[i], i=1..N)];
f   := Matrix(N^P, P, (i,j) -> `if`(j=P, niv[(i mod 3)+1], niv[iquo(i-1,3)+1]));

niv := [Z[1], Z[2], Z[3]]

 

f := Matrix(9, 2, {(1, 1) = Z[1], (1, 2) = Z[2], (2, 1) = Z[1], (2, 2) = Z[3], (3, 1) = Z[1], (3, 2) = Z[1], (4, 1) = Z[2], (4, 2) = Z[2], (5, 1) = Z[2], (5, 2) = Z[3], (6, 1) = Z[2], (6, 2) = Z[1], (7, 1) = Z[3], (7, 2) = Z[2], (8, 1) = Z[3], (8, 2) = Z[3], (9, 1) = Z[3], (9, 2) = Z[1]})

(1)

ds := subs(niv =~ [$0..N-1], f);

ds := Matrix(9, 2, {(1, 1) = 0, (1, 2) = 1, (2, 1) = 0, (2, 2) = 2, (3, 1) = 0, (3, 2) = 0, (4, 1) = 1, (4, 2) = 1, (5, 1) = 1, (5, 2) = 2, (6, 1) = 1, (6, 2) = 0, (7, 1) = 2, (7, 2) = 1, (8, 1) = 2, (8, 2) = 2, (9, 1) = 2, (9, 2) = 0})

(2)

vs := [ seq(V__||i, i=1..P)]:
es := unapply( sort( [ seq( mul(vs ^~ [entries(ds[i,..], nolist)]), i=1..N^P) ] ), vs);
 

proc (V__1, V__2) options operator, arrow; [1, V__1, V__2, V__1^2, V__2^2, V__1*V__2, V__1*V__2^2, V__1^2*V__2, V__1^2*V__2^2] end proc

(3)

ff := convert([ seq(es(entries(ffd[i,..], nolist)), i=1..N^P) ], Matrix);


UnityRoots := [solve(z^3=1, z)]:
F := simplify(subs(niv =~ UnityRoots, ff)) /~ sqrt(N^P):

ff := Matrix(9, 9, {(1, 1) = 1, (1, 2) = Z[1], (1, 3) = Z[2], (1, 4) = Z[1]^2, (1, 5) = Z[2]^2, (1, 6) = Z[1]*Z[2], (1, 7) = Z[1]*Z[2]^2, (1, 8) = Z[1]^2*Z[2], (1, 9) = Z[1]^2*Z[2]^2, (2, 1) = 1, (2, 2) = Z[1], (2, 3) = Z[3], (2, 4) = Z[1]^2, (2, 5) = Z[3]^2, (2, 6) = Z[1]*Z[3], (2, 7) = Z[1]*Z[3]^2, (2, 8) = Z[1]^2*Z[3], (2, 9) = Z[1]^2*Z[3]^2, (3, 1) = 1, (3, 2) = Z[1], (3, 3) = Z[1], (3, 4) = Z[1]^2, (3, 5) = Z[1]^2, (3, 6) = Z[1]^2, (3, 7) = Z[1]^3, (3, 8) = Z[1]^3, (3, 9) = Z[1]^4, (4, 1) = 1, (4, 2) = Z[2], (4, 3) = Z[2], (4, 4) = Z[2]^2, (4, 5) = Z[2]^2, (4, 6) = Z[2]^2, (4, 7) = Z[2]^3, (4, 8) = Z[2]^3, (4, 9) = Z[2]^4, (5, 1) = 1, (5, 2) = Z[2], (5, 3) = Z[3], (5, 4) = Z[2]^2, (5, 5) = Z[3]^2, (5, 6) = Z[2]*Z[3], (5, 7) = Z[2]*Z[3]^2, (5, 8) = Z[2]^2*Z[3], (5, 9) = Z[2]^2*Z[3]^2, (6, 1) = 1, (6, 2) = Z[2], (6, 3) = Z[1], (6, 4) = Z[2]^2, (6, 5) = Z[1]^2, (6, 6) = Z[1]*Z[2], (6, 7) = Z[1]^2*Z[2], (6, 8) = Z[1]*Z[2]^2, (6, 9) = Z[1]^2*Z[2]^2, (7, 1) = 1, (7, 2) = Z[3], (7, 3) = Z[2], (7, 4) = Z[3]^2, (7, 5) = Z[2]^2, (7, 6) = Z[2]*Z[3], (7, 7) = Z[2]^2*Z[3], (7, 8) = Z[2]*Z[3]^2, (7, 9) = Z[2]^2*Z[3]^2, (8, 1) = 1, (8, 2) = Z[3], (8, 3) = Z[3], (8, 4) = Z[3]^2, (8, 5) = Z[3]^2, (8, 6) = Z[3]^2, (8, 7) = Z[3]^3, (8, 8) = Z[3]^3, (8, 9) = Z[3]^4, (9, 1) = 1, (9, 2) = Z[3], (9, 3) = Z[1], (9, 4) = Z[3]^2, (9, 5) = Z[1]^2, (9, 6) = Z[1]*Z[3], (9, 7) = Z[1]^2*Z[3], (9, 8) = Z[1]*Z[3]^2, (9, 9) = Z[1]^2*Z[3]^2})

(4)

Scalar products of pairs of comumn vectors

F must be an orthogonal array

for i1 from 1 to N^P do
  for i2 from 1 to N^P do
    printf("%a ", simplify(add(F[..,i1] . F[.., i2])))
  end do:
  printf("\n"):
end do:
printf("\n");

1 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0
0 0 0 0 1 0 0 0 0
0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 1
 

 

or more simply:

simplify(F^+ . F)

Matrix([[1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0]])

(5)

 


 

Download Too_Blind_To_Find_My_Mistake.mw

First 10 11 12 13 14 15 16 Last Page 12 of 72