## Loop appearing before else in an if statement - se...

Does anyone know why the following gives an error of invalid loop statement termination?

if true then
for i from 1 to 2 do
end do
else
end if

while putting a semicolon after `end do' fixes it.

This seems to only occur in if else statements, when end do appears directly before the else

## Update standings...

update_standings_ELO_draw.mw

This latest question involves ELO, which is used to rate chess players (and other sports).

The difference between the previous (win-loss) system and ELO is the allowance for a third option, a draw. Carl coded the previous rating system, and I have tried to alter it.

See code for ELO procedure.

Adding a D to the third field, gets the result I want.

ELO(Record(rating= 2400),Record(rating= 2000),D)

Adding anything other than D to the third field means the first player defeats the second.

My preference would be to leave nothing in this third field to signify this (but I don't know if this is possible).

The main problem is getting the bulk processing to work (for a series of matches...)

See Update procedure.

I have this flawed notation:

Games:= [[Tom_C, David_J, D],[David_J, Tom_C]]: #Tom_C drew David_J then David_J defeats Tom_C.

Hope someone can help.

## Problem with Physics:-Define...

Consider the following expression (omega being the socalled minimal spin connection in the vierbein formalism of general relativity):

```with(Physics):
+e_[~rho,c]*(d_[mu](e_[rho,d]) - d_[rho](e_[mu,d]))
-e_[~rho,d]*(d_[mu](e_[rho,c]) - d_[rho](e_[mu,c]))
)
-1/2*e_[~a,mu]*e_[~rho,c]*e_[~sigma,d]*(d_[rho](e_[sigma,a]) - d_[sigma](e_[rho,a]));

The Define command raises "Error, (in Physics:-Define) numeric exception: division by zero" in Schwarschild spacetime (loaded with g_[sc]), but not, say, in Tolman spacetime (loaded with g_[tolman]). Furthermore, if either the first two terms, or the last term, are/is removed in omega, then no error is raised in Schwarzschild spacetime. What is going on?

## How to get a real number output. ...

I entered this function
f:=x->(4*x^2-4)^(4/5);

Then I entered f(0) and got (-4)^(4/5).

When I tried to approximate , I got -2.452480922+1.781831689*I

I am looking for the real number value, which is 3.031433 with my TI-83 calculator and here https://www.desmos.com/calculator/b1soxuhbri

How do I set it in maple so that x is assumed to be real in f(x) and all outputs are real.

## How to code an if statement with a variable not eq...

Hello! I am trying to make an if statement that is IF a bound is not equal to NULL, it does things, and if it IS equal to NULL, the bounds are set to zero. When a bound is null, they say

bound1:=()

bound1:=solve(tau(x)=(Intv||j)[1],x,useassumptions) assuming (Intv||i)[1]<=x<=(Intv||i)[2] ;

bound2:=solve(tau(x)=(Intv||j)[2],x,useassumptions) assuming (Intv||i)[1]<=x<=(Intv||i)[2];

if bound1<>NULL;bound2<>NULL;  then

if bound1<=bound2   then

lower:=bound1;  upper:=bound2

else lower:=bound2;   upper:=bound1 end if;

else lower:=0; upper:=0 end if;

## How to get the computation time when I use "Grid:-...

I was using the following idea to get the computation time of my computations in Maple;

```s:=time():
my computation
print(time()-s);```

But it seems if I use

`Grid:-Map(m->My computation(m),[some sequence]);`

Where the sequence has more than one element, this idea doesn't work! It seems Maple time() remains fixed during this Grid:-Map when the sequence has more than one element. So then how should I check the computation time?

In the following pictures you can see when the sequence has one element, it works normal, but when it has two elements, it doesn't work the same.

## How do I compute a function on imported data table...

Please house, I need help on how to compute a funtion a set of column data imported into maple and subsequently output results in a new column on the table.

I have successfully imported the table data from excel but I needed to write a code to recognize the column/columns I want to use as variables in the function and compute results using the column's data. Data table holds up to 14 x 25 datasets.

Any advice would be well appreciated.

## How to show a Matrix and a Plot in a Pop-Up Window...

Hello everybody,

I am quiet new to Maple and just have to program a small tool.

I need to show a conculison in a pop-up Window which should contain a matrix and a plot.

I tried different ways but they didn't work.

## Physics package bug in Maple2017...

Hello,

it seems that Maple2017 handles the noncommutative product wrongly (while it used to do it properly up to maple 17 afaik).

CODE:

with(Physics);
Setup(noncommutativeprefix={P,Q});
Q^2*P*Q + Q*P*Q^2;
simplify(%);

gives a correct result: BUT

Q(t)^2*P(t)*Q(t) + Q(t)*P(t)*Q(t)^2;
simplify(%)

gives the result:

2Q(t)^3*P(t)  (which is wrong).

It used to work fine in Maple 17. I need to differentiate noncommutative polynomials in P(t), Q(t), which was done without problem in Maple 17 but now seems to be broken.

Any explanation/workaround/fix? Is it fixed in Maple 2018?

 >
 >
 >
 >
 >
 (1)
 >
 >
 (2)
 >
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 (7)
 >
 (8)
 >
 (9)
 >
 (10)
 >
 (11)
 >
 (12)
 >
 (13)
 >
 (14)
 >
 (15)
 >
 (16)
 >
 (17)
 >
 (18)
 >
 (19)
 >
 (20)
 >
 (21)
 >
 (22)
 >
 (23)
 >

## How to plot multiple lines from lists?...

Hello everyone,

I am currently trying to plot lines from different lists.

I got 3 lists with points and another 3 lists with points (Connect each point from one list with the other), and another list with my x-axis.

I tried something like that

(nply in this case is 4)

for i from 1 to nply do

sigma1P1[i] := display(line([grenzeu[i], sigma1unter[i]], [grenzeo[i], sigma1ober[i]])):

sigma2P1[i] := display(line([grenzeu[i], sigma2unter[i]], [grenzeo[i], sigma2ober[i]])):

tau12P1[i] := display(line([grenzeu[i], tau12unter[i]], [grenzeo[i], tau12ober[i]])):

end do:
plot:-display(sigma1P1,sigma2P1,tau12P1);

The for loop creates 3 tables with 4 line plots, but the plot:-display(sigma1P1,sigma2P1,tau12P1);

gives me this Error message:

Error, `plot` does not evaluate to a module

Have anyone an idea how to get these 3 table with plots in one plots?

Plot_problem.mw

And if yes is it possible to implement this in a EMbedded Plot Window?

## solve a set of parametric inequalities...

Dear all

I want to solve a set of parametric inequalities with constraints but it takes too much time to processing. do you know any faster solution?

## How do i solve inequalities ?...

Dear friends, i want to solve inequalities as follow:

solve({0 < Q, 0 < delta, 0 < t, 0 < E[0], 0 < lambda[1], 0 < (lambda[1]^2*(Q+2*t+4*delta-4*E[0])+lambda[1]*(Q+2*t+3*delta-7*E[0])-3*E[0])/((lambda[1]^2-6*lambda[1]-6)*t), Q < -(3*delta*lambda[1]+2*t*lambda[1]-4*E[0]*lambda[1]+6*delta-3*E[0])/lambda[1], delta < E[0]*(4*lambda[1]+3)/(3*(lambda[1]+2)), t < -(3*delta*lambda[1]-4*E[0]*lambda[1]+6*delta-3*E[0])/(2*lambda[1]), lambda[1] < 1, (lambda[1]^2*(Q+2*t+4*delta-4*E[0])+lambda[1]*(Q+2*t+3*delta-7*E[0])-3*E[0])/((lambda[1]^2-6*lambda[1]-6)*t) < (lambda[1]*(-2*Q-4*t-2*delta+3*E[0])-lambda[1]^2*delta+lambda[1]^2*E[0]+2*E[0]-2*Q-4*t)/((lambda[1]^2-6*lambda[1]-6)*t) and (lambda[1]*(-2*Q-4*t-2*delta+3*E[0])-lambda[1]^2*delta+lambda[1]^2*E[0]+2*E[0]-2*Q-4*t)/((lambda[1]^2-6*lambda[1]-6)*t) < 1})

But, processing is very heavy and takes too much time! is there any alternative solution?

## How do I calculate inverse laplace of below Functi...

rho := -2*K*(s+K)^2*k[e]*sinh((s+K)*x/d)/(s*d^2*(4*(s+K)^3*cosh((s+K)*h/d)*h/d^2-4*K*(s+K)*cosh((s+K)*h/d)*h/d+4*sinh((s+K)*h/d)*K))

l.mw

All variables are constant except s and x