## MaplePrimes Questions

### Latest Questions Unanswered Questions Maple Maple T.A. MapleSim Latest Questions Feed

Search Questions:

## How do I put discussions, mixed with executable bl...

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

## Help with iteratives...

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!

## Constraints in LPSolve...

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.?

## Function coefficient general...

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.

## run code for plot the region...

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 i 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)});

## Where is wrong in this code?...

This is my code

restart; L := [];
for a from -10 to 10 do
for b from -10 to 10 do
for c from -10 to 10 do
k := (-a*b*c+a*b*z+a*c*y+b*c*x)/igcd(a*b, b*c, c*a, a*b*c); if a*b*c <> 0 then L := [op(L), [[a, 0, 0], [0, b, 0], [0, 0, c]], k*signum(lcoeff(k)) = 0] end if end do end do end do; nops(L); L

I think my code was error, because  a from -10 to 10.

## How can I find an eigenvector for this equation?...

[Delta][4*4]*{b}[4*1]={0}

Which {b} is an eigenvector

## How do I solve the example from Maple Help LPSolve...

When I try the example from Maple Help for LPSolve (I use Windows)

with(Optimization);
LPSolve(-4*x-5*y, {0 <= x, 0 <= y, x+2*y <= 6, 5*x+4*y <= 20});

I do not get the same solution like in the example: [-19., [x = 2.66666666666667, y = 1.66666666666667]]

Warning, problem appears to be unbounded
[0., [x = HFloat(0.0), y = HFloat(0.0)]]

My Professor uses the same version, but with Linux and do not have such problems. Why my installation does not solve the standart Help example?

Thank you

## Maximum of complex function ...

Hi

Let D={ Z=x+I*y,    -Pi*(n+1/2) <= x, y <= Pi*(n+1/2)}

z belong the boundary of the previous square.

I would like to compute the modul of this function  f (z) =  coth(z) using the usual function  cos(x) cos(y), sinh(x) or cosh(y)  and show that | f(z)|  is less than one

Many thanks for any help

## Adding a function to a matrix...

Hello, im a total begineer with maple and i need help defining a matrix, i need to get this into a matrix

anyone knows how could i put this in a matriz of n x 1?   (the one thats only a column)

any help would be greatly appreciated

## Writing a procedure for a matrix...

Hello I was trying to manipulate maple to write a procedure checking a matrix , say A with n rows and n columns. That matrix A given any row/column the sum of the entries for every row and column are equal. For example matrix [(-1,2)(2,-1)], every row and column in this matrix sums to 1. The entries in the matrix can be any real number.

## Parametric plot in 3D...

Put x=f1(t1,t2,t3), y=f2(t1,t2,t3), z=f3(t1,t2,t3).

The question is that: How to plot all points of form [x,y,z] with t1 in [a1,b1], t2 in [a2,b2], t3 in [a3,b3].

Thank you.

## -Float(infinity) in calculating integral...

hi.

''''

-Float(infinity)*signum((5.*A3*A1-24.*A2^2)*A1/A2^2)''''

 (1)

 (2)

 (3)

## Installation Problem...

Hello.

I've just installed Maple 2015 and when I started it, this happened

It seemed that something was wrong with the graphics or java. But I really don't know what to do next.

## How can I force Maple to be smarter about roots of...

Say I define the following variables.

These are all nineth roots of unity. An equivalent definition would be:

In fact, the following code shows that aa[i] /a[i] =1 for all i, so one would concluse aa[i]=a[i]:

for i to 9 do
simplify(a[i]/aa[i])
end do

But when I try to check via "Equal":

I get as output

true
false
false
false
false
false
true
false
false
The problem goes even further since one representation is accepted as a solution of a linear equation system while the other is not.

Another curiosity:

gives just the same expression, whereas simplifying the same expression to the third power gives 0.

 1 2 3 4 5 6 7 Last Page 1 of 1408
﻿