MaplePrimes Questions

Hallo. I'd like to use two commands in loop like:

for i from 1 by 1 to k  do r:=Search(polyQ[i],[Q]) and T[r]:=T[r]-polyeq[i] end do

But Maple: "Error, unterminated loop". Hmm...

Can maple solve maximization problem like

q := proc (a, b, c) options operator, arrow; .2*b+.1*c end proc;
print(`output redirected...`); # input placeholder
(a, b, c) -> 0.2 b + 0.1 c
w := proc (a, b, c) options operator, arrow; .7*a+.1*c end proc;
print(`output redirected...`); # input placeholder
(a, b, c) -> 0.7 ab + 0.1 c
e := proc (a, b, c) options operator, arrow; .7*a+.2*b*c end proc;
print(`output redirected...`); # input placeholder
(a, b, c) -> 0.7 a + 0.2 b c

with(Optimization)

Maxmize(int(min(100+(.7*a+q)*(1/2), a), q)+int(min(100+(.2*b+w)*(1/2), b), w)+int(min(100+(.1*c+e)*(1/2), c), e)-a-b-c-ab-ac-bc)

Error, (in Optimization:-NLPSolve) cannot convert procedures to piecewise

 

 

Thanks alot if you can help me.Urgent! Really appreciate.

 

Hi,

Anyone knows how to define a ring of polynomials with variables x_1,...,x_n such that x_i*x_j = -x_j*x_i if i \neq j?

I tried using the Physics package and AntiCommutator but the problem is that in that case the variables anticommute with themselves so I have x_i^2=0.

If there is no direct way to this, I guess I could define a procedure that would look at the monomials of a polynomial and order them in lexicographic order and each time it switches two variables with different index it would multiply the monomial by -1.

I also don't know how to do that since I don't know how to look at a specific term in a monomial. For example, if my monomial is x_ix_jx_k, is there a way to find the first two variables and then switch them if LexOrder(variable1,variable2)= LexOrder(x_i,x_j)= false, i.e. if i>j?

Thanks,

M-A

Hi there,

I used the following plot command in maple13.

with(plots):

implicitplot(abs(x)+abs(y)=2, x=-2..2, y=-2..2, scaling=constrained)

But the output(square) is not complete at vertices.In fact at the vertex the graph is like a trapezoid.

Any help will be appreciated.

Yegan

 

hi

i have solved my equation as folllow :

 

pde:= diff(T(x, y), x)-1.555*10^(-7)*(diff(T(x, y), y, y))/ ...........

 

sol := pdsolve(pde, {T(0, y) = 0, (D[2](T))(x, 0) = 1325.754092, (D[2](T))(x, 0.25e-4) = 1970434.783}, numeric)

 

I wana know that maple has used which of numeric method to solve my equation ?

 

1.ForwardTime1Space[forward/backward]

2.CenteredTime1Space[forward/backward]

3.BackwardTime1Space[forward/backward]

4.ForwardTimeCenteredSpace or Euler

5.CenteredTimeCenteredSpace or CrankNicholson

6.BackwardTimeCenteredSpace or BackwardEuler

7.Box

8.LaxFriedrichs

or ... ?

 

Tahnks.

For different reasons I need to ocasionally export a number of Maple worksheet in a folder to pdf files. Is there a way to automate this? I would want that the worksheet is opened, output removed, then executed and eventually exported to pdf. It can take quite a while to do this manually for about 50 worksheets.

Dear people in Maple primes,

 

Please tell me why algsubs would not work well in the following case.

 

algsubs(-eta*M[n]/(gamma*(eta*M[n]+gamma))-1/(eta*M[n]+gamma) = factor(-eta*M[n]/(gamma*(eta*M[n]+gamma))-1/(eta*M[n]+gamma)), (-eta*M[n]/(gamma*(eta*M[n]+gamma))-1/(eta*M[n]+gamma))*p[i]+(int(p[i], i = 0 .. M[n]))*eta/(gamma*(eta*M[n]+gamma))+alpha/(eta*M[n]+gamma));

 

Following error message appeared when the above code is executed:

Error, (in algsubs) cannot compute degree of pattern in eta

 

Best wishes.

 

taro

 

 

 

 

 

 

 

HI, dear all. When I tried to use the plot option 'adaptive' to make my plot more smooth and realistic, I encountered the following erro. I cannot understand why. From the help guide, I learn that adaptive can be assigned n or true or false, but errors appeared.  Thanks for your help.

 

> implicitplot(-x^3+3*x+a = 0, a = -3 .. 3, x = -4.0 .. 4.0, view = [-3 .. 3, -4 .. 4], adaptive = 2, resolution = 1000, numpoints = 2000);
Error, (in plot/options2d) unexpected option: adaptive = 2
> help("adaptive");

Hello
I encountered with a problem in understanding of structured types. I test following structured types:



the result is

true

false
false

I cannot understand two last results as I expected to receive trues. Could you explain me the result?
Thank you.

UPD
A code appropriate for copy/pase along with short problem solution is presented below

restart;
`type/A1`:={integer, rational};
`type/A2`:=integer or rational; #  it matchs the expressions that literally contain `or` (see @Carl Love's
answer below)
`type/A3`:=OR(integer, rational); # `Or` should be used rather then `OR` (see @acer's
answer below)

x:=5;
type(x, A1);
type(x, A2);
type(x, A3);

> restart;
> with(plots);
> Eq1 := diff(f(eta), eta, eta, eta)+f(eta)*(diff(f(eta), eta, eta))-2*(diff(f(eta), eta))^2-M^2*(diff(f(eta), eta)) = 0;
/ d / d / d \\\ / d / d \\
|----- |----- |----- f(eta)||| + f(eta) |----- |----- f(eta)||
\ deta \ deta \ deta /// \ deta \ deta //

2
/ d \ 2 / d \
- 2 |----- f(eta)| - M |----- f(eta)| = 0
\ deta / \ deta /
> Eq2 := 1+(4/3)*R*(diff(theta(eta), eta, eta))+Pr*(f(eta)*(diff(theta(eta), eta))-(diff(f(eta), eta))*theta(eta)) = 0;
4 / d / d \\
1 + - R |----- |----- theta(eta)||
3 \ deta \ deta //

/ / d \ / d \ \
+ Pr |f(eta) |----- theta(eta)| - |----- f(eta)| theta(eta)| = 0
\ \ deta / \ deta / /
> bcs1 := f(0) = S, (D(f))(0) = 1+L*G, (D(D(f)))(0) = .1, f(6) = 0;
f(0) = S, D(f)(0) = 1 + L G, @@(D, 2)(f)(0) = 0.1, f(6) = 0
> fixedparameter := [S = .1, M = .1];
[S = 0.1, M = 0.1]
> Eq3 := eval(Eq1, fixedparameter);
/ d / d / d \\\ / d / d \\
|----- |----- |----- f(eta)||| + f(eta) |----- |----- f(eta)||
\ deta \ deta \ deta /// \ deta \ deta //

2
/ d \ / d \
- 2 |----- f(eta)| - 0.01 |----- f(eta)| = 0
\ deta / \ deta /
> fixedparameter := [R = .1, Pr = .7];
[R = 0.1, Pr = 0.7]
> Eq4 := eval(Eq2, fixedparameter);
/ d / d \\ / d \
1 + 0.1333333333 |----- |----- theta(eta)|| + 0.7 f(eta) |----- theta(eta)|
\ deta \ deta // \ deta /

/ d \
- 0.7 |----- f(eta)| theta(eta) = 0
\ deta /
> bcs2 := theta(0) = 1+T*B, (D(theta))(6) = B, theta(6) = 0;
theta(0) = 1 + T B, D(theta)(6) = B, theta(6) = 0

> T := .1; B := .1;
0.1
0.1
> L := [0., .1, .2, .3];
[0., 0.1, 0.2, 0.3]
> for k to 4 do R := dsolve(eval({Eq3, Eq4, bcs1, bcs2}, L = L[k]), [f(eta), theta(eta)], numeric, output = listprocedure); Y || k := rhs(R[2]); YL || k := rhs(R[3]) end do;
Error, (in dsolve/numeric/bvp/convertsys) too many boundary conditions: expected 6, got 7
> plot([YL || (1 .. 4)], 0 .. 6, 1 .. -.2, labels = [eta, diff(f(eta), eta)]);

 

Dear all;

I need your help to get all the solution of this nonlinear  system  with four parameters: r1, r2, q1, q2  assumed to be positives. Let the system:

the first equation is: r1*x*(1-x/q1)=x*y/(1+x)

the second equation: r2*y*(exp(-y)-q2)=-x*y/(1+x)

How can get the positive solution ( x, y) of the previous system.

Thank you for your help.

Dear Exppert,

I used the following command to plot the volume of revolutionin Maple13, but with the message "unable to invert function w.r.t. the vertical axis."

with(Student[Calculus1]):

VolumeOfRevolution(sqrt(1-(x-4)^2), -sqrt(1-(x-4)^2), x=3..5, axis=vertical, scaling=constrained, output=plot).

Meanwhile, this command can plot each function individually, which is a semi-torus.

Regards

Yegan

Hi

I'm trying make Maple write the actual result, when i differenting an expression: x[s] := x(t)+sin(theta(t))*a.
when i differentiate with respect to t, i get:

> diff(x[s], t);
=
print(`output redirected...`); # input placeholder
/ d \ / d \
|--- ()(t)| + cos(theta(t)) |--- theta(t)| a
\ dt / \ dt /

Maple, writes the expression as a table, but i need to see the normal function? Why does it do that? And how can i make it show the expression as a normal function?


When i derive the two parts serperately i get the normal result, but as soon as i add them together, i get the table rasult again?

Is there an easy trick for this one?

-Nicolai

 

 

Hello.
I am trying to extract the terms that are a product of a commutative part and an operator part from the input expression. That is I am trying to extract a terms like a*A.B where A and B are quantum pperators.

I am trying to do it by creating corresponding structured type:

restart; 
with(Physics);
Physics[Setup](op = {A, B}, quiet);

`type/ProdComOp` := `&*`(commutative, specfunc(anything, Physics:-`*`));
z0 := u*A.B-A+k*B+B.A.B+g;
z1 := z0+v*A.B.A;
S1 := indets(z1, ProdComOp);

and all it is Ok. The result is 
But if

z2 := z0-v*A.B.A; 
S2 := indets(z2, ProdComOp);

then
however I expected to receive the same as S1.

How to handle the sign of the commutative part? Thank you.

Hi,

 

  I would like to readdata from a file 

              -6
2 0.38 10 + 0. I

 

  I use

 

f:=readdata(`d:\\test.dat`,2);
for i from 1 to 20 do
print(i,f[i]);
end do:

 

  The problem is, seems maple get -6, instead of 10^-6, since the .txt file puts -6 in a row. 

 

My question is, how to get the right data 0.38*10^-6 correctly?

 

P.S. I used cmaple  inputfile >  outputfile.txt to get the .txt file. Should I use writedata?

 

 

First 1351 1352 1353 1354 1355 1356 1357 Last Page 1353 of 2434