Thomas Richard

Mr. Thomas Richard

3496 Reputation

13 Badges

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

MaplePrimes Activity


These are answers submitted by Thomas Richard

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:
ra := convert(ro,radical);
evala(Minpoly(ra,x));

 

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

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

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

sineExpr-evalc.mw
 

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

proc (m::posint) local t, j; options operator, arrow; 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) end proc

(1)

sineExpr(1);

sin(a[1]-b[1])

(2)

combine(evalc(normal(convert(sineExpr(1),exp),expanded)));

sin(a[1]-b[1])

(3)

combine(evalc(normal(convert(sineExpr(2),exp),expanded)));

sin(a[2]+a[1]-b[1]-b[2])

(4)

combine(evalc(normal(convert(sineExpr(3),exp),expanded)));

sin(a[3]+a[2]+a[1]-b[2]-b[3]-b[1])

(5)

combine(evalc(normal(convert(sineExpr(3),exp),expanded)));

sin(a[3]+a[2]+a[1]-b[2]-b[3]-b[1])

(6)

combine(evalc(normal(convert(sineExpr(4),exp),expanded)));

sin(a[4]+a[3]+a[2]+a[1]-b[3]-b[2]-b[4]-b[1])

(7)

combine(evalc(normal(convert(sineExpr(5),exp),expanded)));

sin(a[4]+a[3]+a[2]+a[1]+a[5]-b[2]-b[3]-b[1]-b[5]-b[4])

(8)

 


 

Download sineExpr-evalc.mw

 

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.

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

 

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.

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.

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

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):

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

 

Try this function definition instead:

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

 

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

 

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.

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.

1. Check out the Maple Calculator App which is available for iOS and Android. It's fairly powerful, though I don't know the Sharp calculator you mentioned.

2. Please specify what you mean by "using" here. What do you want to emulate? Maple platform support is covering the three mainstream operating systems: Windows, Linux, macOS.

1 2 3 4 5 6 7 Last Page 3 of 45