Thomas Richard

Mr. Thomas Richard

3496 Reputation

14 years, 139 days
Maplesoft Europe GmbH
Technical professional in industry or government
Aachen, North Rhine-Westphalia, Germany

Not a bug - this is by design...

Maple does not convert that cosine value to an algebraic number by default, so we need to insert one step (or two if wanted):

```rt := cos(2*Pi/7);
ro := convert(rt,RootOf);
evala(Minpoly(ro,x));
# if you want to see an explicit representation of the root:
evala(Minpoly(ra,x));

```

Workaround...

No, a KCL error is not expected, of course. Supplying a method option helps, though:

```int(integrand,x,method=MeijerG);
int(integrand,x,method=Risch);
```

Suggestion using evalc...

Here's an approach using conversion to complex exponentials and then evalc'ing.

Probably not the most efficient, but easy to write down...

 > restart:
 >
 > sineExpr := (m::posint) -> local t, j; add(mul(ifelse(j <> t, sin(a[j] - b[t])/sin(b[j] - b[t]), sin(a[t] - b[t])), j = 1 .. m), t = 1 .. m);
 (1)
 > sineExpr(1);
 (2)
 > combine(evalc(normal(convert(sineExpr(1),exp),expanded)));
 (3)
 > combine(evalc(normal(convert(sineExpr(2),exp),expanded)));
 (4)
 > combine(evalc(normal(convert(sineExpr(3),exp),expanded)));
 (5)
 > combine(evalc(normal(convert(sineExpr(3),exp),expanded)));
 (6)
 > combine(evalc(normal(convert(sineExpr(4),exp),expanded)));
 (7)
 > combine(evalc(normal(convert(sineExpr(5),exp),expanded)));
 (8)
 >

Not much simpler...

The r.h.s. of your solution (multiplied by a constant factor) can be obtained via

`simplify(sol,symbolic);`

which is also confirmed by odetest.

Example incorrect?...

Your initial example cannot be correct; please plot the hypergeom and the elementary representations. Maybe some typo or copy&paste error (which I often make...)?

Three of the four in your list are covered by

`convert(%,StandardFunctions);`

evala and factor...

The recommended tool for evaluating algebraic numbers is evala. However, some preprocessing is needed for this expression:

`evala(factor(expr));`

In theory, factoring should not be necessary. So that's a weakness, I'd say.

Typo / input formatting...

In the definition of C2, you need to remove all the spaces so that it's recognized as a floating-point number, just like the other parameters. Otherwise it will be interpreted as an expression involving the unbound symbol e, which is syntactically valid - thus no error message appears.

The solve call will provide the approximate roots then, without resorting to RootOf representations. And no need to call allvalues.

Some cleanup and suggestions...

You almost had it correct; essentially only the curly braces around Cond had to be removed. Some more cleanup was done in the attached file.

exact_solution_error_TR.mw

Edit: two errors of mine fixed

DocumentTools:-Tabulate...

You could strip off the first column by appending [..,2..] to the definition of TR. However, that is ignored by the summarize=embed option. To work around, omit the option and do the embedding in a separate step:

```TR := FrequencyTable(Obs, weights = Eff, headers, tableweights = [4, 2, 2, 2, 2])[..,2..]:
DocumentTools:-Tabulate(TR):```

By the way, some previous steps can be shortened considerably, e.g.

```Obs := lhs~(L):
Eff := rhs~(L):```

Using gfun package command listtorec and...

If we supply one more item in the first list, it will work right away.

And for the second list, did you mean to start with 0, or perhaps 2? If I choose the latter, a simple result is found:

```restart:
with(gfun):
List1 := [0,4,16,36,64,100,144]:
List2 := [2,3,6,11,18,27,38]:

R1 := listtorec(List1,f1(n));
rsol1 := rsolve(op(1,R1),f1(n));
simplify(rsol1);

R2 := listtorec(List2,f2(n));
rsol2 := rsolve(op(1,R2),f2(n));
simplify(rsol2);
```

Typo...

`phi := (x, y) -> Transpose(Multiply(Miv,<x,y,1>));`

Series solution...

You can also obtain a series solution of this IVP as follows:

```sys_ivp := [sys_ode, ics]:
vars := [x(t),y(t)]:
sols := dsolve(sys_ivp, vars, 'series');
solp := convert(sols, 'polynom');
plot(map(rhs,solp),t=0..10);
```

Maple Player...

Can your colleague install the free Maple Player?

It should display your Maple file(s) properly, and you wouldn‘t need to export to PDF.

Option 'wronskian' required...

The simplify command needs an option here (perhaps it was applied by default in that older version, but I doubt that):

`simplify(f,'wronskian');`

This will return 1 right away.