MaplePrimes Questions

I have a list
restart;
L := [10*x+y-6*z+66 = 0, 26*x-10*y-3*z+96 = 0, 2*x-y+6 = 0, 2*x-y+6 = 0, 4*x-5*y+3*z-6 = 0, 30*x-22*y+7*z+48 = 0, 2*x-2*y+z = 0, 26*x-19*y+6*z+42 = 0, 22*x-17*y+6*z+30 = 0, 14*x-30*y+23*z-96 = 0, 6*x-10*y+7*z-24 = 0, 2*x-7*y+6*z-30 = 0, 4*x-y-z+10 = 0, 42*x-2*y-19*z+20 = 0, 38*x-2*y-17*z+20 = 0, 30*x-y-14*z+10 = 0, 18*x+2*y-11*z-20 = 0, 6*x+13*y-16*z-130 = 0, 18*x+7*y-16*z-70 = 0, 6*x+2*y-5*z-20 = 0, 14*x+15*y-22*z-150 = 0, 18*x+13*y-22*z-130 = 0, 6*x+4*y-7*z-40 = 0, 26*x-3*y-10*z+110 = 0, 10*x-6*y+z+52 = 0, 2*x-z+8 = 0, 26*x+6*y-19*z+92 = 0, 22*x+6*y-17*z+76 = 0, 2*x+y-2*z+6 = 0, 14*x-18*y+11*z+92 = 0, 2*x-6*y+5*z+20 = 0, 2*x+6*y-7*z-4 = 0, 10*x-3*y-2*z+22 = 0, 26*x-7*y-6*z+66 = 0, 2*x-y = 0, y-z+11 = 0, 4*x-9*y+7*z-77 = 0, 6*x-5*y+2*z-22 = 0, 24*x-13*y+z-11 = 0, 2*x-y = 0, 2*x-y = 0, y-z+11 = 0, 4*x-5*y+3*z-33 = 0, 6*x-4*y+z-11 = 0, 4*x-3*y+z-11 = 0, 18*x-19*y+10*z-110 = 0, 14*x-13*y+6*z-66 = 0, 2*x-2*y+z-11 = 0, 26*x-6*y-7*z+68 = 0, 10*x-2*y-3*z+24 = 0, 2*x-z+2 = 0, 6*x+y-4*z-1 = 0, 4*x+y-3*z-3 = 0, y-z-7 = 0, 4*x+3*y-5*z-17 = 0, 18*x+10*y-19*z-52 = 0, 8*x+17*y-21*z-111 = 0, 4*x+5*y-7*z-31 = 0, 4*x-3*y+z-2 = 0, 10*x-6*y+z+4 = 0, 14*x-10*y+3*z-4 = 0, 26*x-15*y+2*z+14 = 0, 22*x-13*y+2*z+10 = 0, 18*x-26*y+17*z-84 = 0, 2*x-6*y+5*z-28 = 0, 38*x-6*y-13*z-16 = 0, 6*x-y-2*z-2 = 0, 18*x-2*y-7*z-16 = 0, 6*x+y-4*z-22 = 0, 6*x+y-4*z-22 = 0, 14*x+11*y-18*z-138 = 0, 2*x+y-2*z-14 = 0, 2*x+y-2*z-14 = 0, 22*x+2*y-13*z+40 = 0, 14*x+3*y-10*z+22 = 0, 2*x-2*y+z+8 = 0, 2*x-5*y+4*z+14 = 0, 2*x+5*y-6*z-6 = 0, 2*x-z+2 = 0, 6*x+y-4*z+8 = 0, 22*x-12*y+z-2 = 0, 8*x-9*y+5*z-10 = 0, y-z+2 = 0, y-z+11 = 0, 2*x-y-9 = 0, 8*x-3*y-z-25 = 0, 34*x-18*y+z-164 = 0, 18*x-10*y+z-92 = 0, 14*x-10*y+3*z-96 = 0, 28*x-17*y+3*z-159 = 0, 8*x-5*y+z-47 = 0, 2*x+3*y-4*z+29 = 0, 4*x-3*y+z-23 = 0, 32*x-15*y-z-103 = 0, 20*x-9*y-z-61 = 0, 10*x-6*y+z-44 = 0, 14*x-10*y+3*z-76 = 0, 2*x-2*y+z-16 = 0, 4*x-3*y+z-23 = 0, 12*x-19*y+13*z-89 = 0, 16*x-19*y+11*z-87 = 0, 20*x-3*y-7*z-73 = 0, 14*x-3*y-4*z-43 = 0, 4*x+3*y-5*z-47 = 0, 16*x-3*y-5*z-53 = 0, 22*x-2*y-9*z-92 = 0, 12*x+5*y-11*z-105 = 0, 16*x+3*y-11*z-107 = 0, 12*x+y-7*z-13 = 0, 6*x+y-4*z-7 = 0, 10*x-14*y+9*z+4 = 0, y-z-7 = 0, 2*x-z-7 = 0, 2*x+9*y-10*z-70 = 0, 18*x+y-10*z-70 = 0, 12*x+11*y-17*z-119 = 0, 2*x+y-2*z-14 = 0, 2*x-4*y+3*z+15 = 0, 4*x+y-3*z-15 = 0, 2*x-11*y+10*z+50 = 0, 14*x+3*y-10*z-50 = 0, 8*x+13*y-17*z-85 = 0, 4*x+13*y-15*z-75 = 0, 2*x+5*y-6*z-30 = 0, 12*x-7*y+z-101 = 0, 2*x-y-15 = 0, 6*x-4*y+z-56 = 0, 6*x-7*y+4*z-47 = 0, 8*x-7*y+3*z-51 = 0, 2*x-4*y+3*z-24 = 0, 6*x+y-4*z-46 = 0, 2*x+3*y-4*z-10 = 0, 2*x-z-16 = 0, y-z+2 = 0, 6*x-2*y-z-52 = 0, 10*x-2*y-3*z-84 = 0, 10*x+y-6*z-78 = 0, 2*x+y-2*z-14 = 0]

Now I want to write the equation of the planes passing two points A and B and perpendicular to all the equations of the above list. I can't to write a proc. With each plane of List, I tried
with(geom3d);
point(A, 1, 5, 3): 
point(B, -2, -4, 3):
with(geom3d): 
Equation(plane(P, L[5], [x, y, z])): 
line(d, [A, B], t):
 n1 := ParallelVector(d):
 n2 := NormalVector(P):
 with(linalg):
 n3 := crossprod(n1, n2):
 k := sort(primpart(lhs(Equation(plane(R, [A, n3], [x, y, z])))));
k*signum(lcoeff(k)) = 0

I got true answer.

Hello,

How can I rotate vertically label of vertical axis ? Can you help me ?

Thank you.

I use maple 2016 on linux with X.  When minimized, the maple icon is very small.  Also, the help icon is very small.

Are larger icons available?

The maple icon is ./bin/Maple2016.png.  I can not find the help icon.  Any ideas?

I want to solve for the roots of a polynomial, such as a x^2+b x + c = 0, for which the output is only the positive root. All coefficients/variables in the polynomial are positive. 

Recently, someone posted an answer to a question where at some point they performed this task and their solution was really slick. But I can't find it. The answer used either solve, or eval or something like that. (Yes, I did perform a search via the MaplePrimes search before asking this question.) 

 

I am trying to calculate the integral

where

Maple cannot calculate the integral. I tried to expand theta in the series form and substitute in the integral, still cannot calculate it.

any suggestion to tackle this problem whould be helpful.

Thank you

 

I have a PDE with boundary conditions, from a NASA paper.  I always seem to have problems expressing the bc.

PDE := diff(u(x, t), t) = (1/4)*exp(2)*exp(-u(x, t))*(diff(diff(u(x, t), x), x))/(x^2+2);

The initial/boundary conditions are

@t=0, u(x, t) = 2-2*ln(-x^2+2)

@x=0, diff(u(x,t),x)=0  ## this is the bc I have problem expressing

@x=1, u(x,t) = 2+ln(1+t)

The exact solution given in the paper:

2 + ln(1+t) - 2*ln(2-x^2)

I tried

ics := u(x, 0) = 2*(1-ln(2-x^2));

bcs := D[1](u(0,t))=0, u(1,t)=2+ln(1+t);

PDEtools[Solve]([PDE,ics,bcs]); ## no solution

How do I do this?

Tom Dean

fn1 and gn1 are the 2x2 matrices. For example
 

fn1:=Matrix(2,2,[seq(f[i],i=1..4)])
gn1:=Matrix(2,2,[seq(g[i],i=1..4)])


eq1:=evalm(Matrix(2,2, [1, 1, 0, 3])&*fn1+gn1)=Matrix(2,2,[0]);

eq2:=evalm(fn1+gn1)=Matrix(2,2, [0]);

how can we find fn1 and gn1 matrices?

Consider the following code:

LM := [
   Matrix([[1,2],[3,4]]),
   Matrix([[5,6],[7,8]])
];
A := Matrix([[0,1],[1,0]]);
map(x -> A . x,LM);
A .~ LM;

where LM is a list of two matrices (just a test example), and A is some (test)matrix that I want to multiply onto each of these two matrices from the left, say. The map-construction works, as expected, but the elementwise operation .~ produces an error. Why?

I have a non-linear function to be optimized. It involves infinite sums. Maple plots the function so I can see where the minimum is. However the NLP solve keeps on evaluating without providing the solution. I have tried to write the function as a procedure but it does not work either.

I'd appreciate any suggestion

 

Greetings

How can I get LPSolve to output the unique subsets of {3,1,1,2,2,1} which sum to 5 (no recycling of set values)

partition.mw

(the code is a Yury/Love hybrid).

I have several maple worksheets (from the web) that have discussion blocks mixed within executable blocks.

All the executable blocks are delineated with a single '[' at the left while the discussion blocks do not.

How do I do this?

Tom Dean

So i got this code, im trying to iterate with jacobi and gaussseidel method.

H := HilbertMatrix(n, n, 1); b := Matrix(n, 1, proc (i) options operator, arrow; add(1/(i+j-1), j = 1 .. n) end proc); A := Matrix(n, 1, 1); Multiply(H, A); norm1H := norm(H, 1); norm2H := norm(H, 2); normHinf := norm(H, infinity); norm1b := norm(b, 1); norm2b := norm(b, 2); norminfb := norm(b, infinity); IterativeApproximate(H, initialapprox = Vector(n, 0), tolerance = 10^(-7), maxiterations = 10, method = gaussseidel)

 

But sadly no iteration gave me an answer, anyone knows wheres my mistake? i really help with this! 


thanks in advance

I wish to apply several i-j constraints to an optimization problem that involves minimizing a function x[i,j]. 

Does anyone know of a simple way to exclude values for i and j? For instance, how do we specify the conditions, i not equal to j, i is not equal to 1, etc.?

Thanks in advance!

 

 

Hi all, i wan to write getCoeff() function get coefficient general.

Example

f := a^2*b^2*c^2 + 2*a^2*b^2 + 2*a^2*c^2 + 2*b^2*c^2 + a^2 - 6*a*b - 6*a*c + b^2 - 6*b*c + c^2 + 8

getCoeff(f,a^2*b^2*c^2) return 1.

getCoeff(f,a^2*b^2) return 2.

getCoeff(f,a*b) return -6.

getCoeff(f,a^2) return 1, ...

and how to get coefficients freedom ?

Thank you very much.

can anyone run my code?
please do it and send it for me.
thanks.

restart;
with(plottools): with(LinearAlgebra): with(plots):
ode := `assuming`([diff(Y(X), `$`(X, 2))+2*alpha*(diff(Y(X), X))+beta^2*Y(X) = 0], [alpha >= 0, beta >= 0, alpha+beta > 0]):
F := unapply(solve(subs({X = x, Y(X) = y, diff(Y(X), X) = yp, diff(Y(X), `$`(X, 2)) = yz}, ode), yz), x, y, yp):
Fp := unapply(solve(subs({X = x, Y(X) = y, diff(Y(X), X) = yp, diff(Y(X), `$`(X, 2)) = yz, diff(Y(X), `$`(X, 3)) = yt}, diff(ode, X)), yt), x, y, yp, yz):
Ni := seq(i, i = 0 .. 9), 15, 20:
for ni in Ni do
print(ni);
st := time[real]();
f[0, ni] := F(x[0], y[0, ni], yp[0, ni]);
fp[0, ni] := Fp(x[0], y[0, ni], yp[0, ni], f[0, ni]);
f[1, ni] := F(x[1], y[1, ni], yp[1, ni]);
fp[1, ni] := Fp(x[1], y[1, ni], yp[1, ni], f[1, ni]);
y[2, 0] := y[0, ni]+2*h*yp[0, ni]+(6/5)*f[0, ni]*h^2+(4/15)*fp[0, ni]*h^3+(4/5)*f[1, ni]*h^2+(4/15)*fp[1, ni]*h^3;
yp[2, 0] := yp[0, ni]+2*f[0, ni]*h+(2/3)*fp[0, ni]*h^2+(4/3)*fp[1, ni]*h^2;
for j to ni do
f[2, j-1] := F(x[2], y[2, j-1], yp[2, j-1]);
fp[2, j-1] := Fp(x[2], y[2, j-1], yp[2, j-1], f[2, j-1]);
y[2, j] := y[1, ni]+h*yp[1, ni]+(7/20)*f[1, ni]*h^2+(1/20)*fp[1, ni]*h^3+(3/20)*f[2, j-1]*h^2-(1/30)*fp[2, j-1]*h^3;
yp[2, j] := yp[1, ni]+(1/2)*f[1, ni]*h+(1/12)*fp[1, ni]*h^2+(1/2)*f[2, j-1]*h-(1/12)*fp[2, j-1]*h^2;
end do:
Ms := Matrix(4, 4); Ms[1, 3] := 1; Ms[2, 4] := 1;
y[2, ni] := collect(algsubs(h*alpha = H1, expand(algsubs(h*beta = H2, expand(y[2, ni])))), {y[0, ni], y[1, ni], yp[0, ni], yp[1, ni]});
Ms[3, 1] := coeff(y[2, ni], y[0, ni]);
Ms[3, 2] := coeff(y[2, ni], yp[0, ni])/h;
Ms[3, 3] := coeff(y[2, ni], y[1, ni]);
Ms[3, 4] := coeff(y[2, ni], yp[1, ni])/h;
hyp[2, ni] := collect(algsubs(h*alpha = H1, expand(algsubs(h*beta = H2, expand(h*yp[2, ni])))), {y[0, ni], y[1, ni], yp[0, ni], yp[1, ni]});
Ms[4, 1] := coeff(hyp[2, ni], y[0, ni]);
Ms[4, 2] := coeff(hyp[2, ni], yp[0, ni])/h;
Ms[4, 3] := coeff(hyp[2, ni], y[1, ni]);
Ms[4, 4] := coeff(hyp[2, ni], yp[1, ni])/h;
sol := Eigenvalues(Ms);
print(time[real]()-st);
st := time[real]();
SR[ni, 1] := implicitplot(max(seq(abs(sol[ii]), ii = 1 .. numelems(sol))) <= 1, H1 = 0 .. 3, H2 = 0 .. 3, filledregions, gridrefine = 3, axes = Boxed, view = [-2 .. 3, -3 .. 3], labels = [H[1], H[2]], labeldirections = ["horizontal", "vertical"]);
SR[ni, 2] := implicitplot(max(seq(abs(sol[ii]), ii = 1 .. numelems(sol))) <= 1, H1 = -2 .. 3, H2 = -2 .. 3, gridrefine = 3, axes = Boxed, view = [-2 .. 3, -3 .. 3], labels = [H[1], H[2]], labeldirections = ["horizontal", "vertical"]);
print(time[real]()-st);
end do;
for i in Ni do
i;
display({SR[i, 1], SR[i, 2], line([-1, 0], [3, 0], color = red, linestyle = dash), line([0, -3], [0, 3], color = red, linestyle = dash)});
end do;
display({seq(SR[i, 2], i = 0 .. Ni)});

First 1020 1021 1022 1023 1024 1025 1026 Last Page 1022 of 2428