vv

12453 Reputation

19 Badges

9 years, 285 days

MaplePrimes Activity


These are replies submitted by vv

restart;
S:=msolve(x^3+y^2 = 123, 124):
S[rand(1..nops([S]))()];

                        {x = 83, y = 72}
eval(x+y, %);
                              155

 

@Stretto 

Now, that you know the syntax, you have options.
For example, in Maple 2019:

(for i from 1 to 3 do    
    A := i:
    B := 10*i;
end);

        10, 20, 30

Or, you may redirect the output into a file and then filter its content.

 

@Carl. I was intrigued by the results obtained by your procedure and I have looked closer to the u[i] inequalities.
The conclusion is that they are ok not only for n, but also for any n'>=n. So, your LPSolve call is correct and should produce the solution. Congratulations for your intuition and vote-up!
Unfortunately, LPSolve does not obtain the global minimum. I have checked with my brute-force procedure; it gives a better solution but this solution satisfies the LPSolve conditions, so it should have been found!

@Carl Love 

1. The triangle inequality must be checked for all i,j,k,  not only for i<j<k. In your example, the resulting matrix violates the triangle inequality.

2. The u[i] variables are for the TSP problem, not VRP. There, u[i] need not be >=0 [actually, obviously, if u[i] satisfy the conditions, u[i]+const satisfy too]. A special solution for u[i] is the step at which the vertex i is visited (but u[i] is not unique).
In VRP the problem is that the tours do not have the length n, so, insted of n should be the lenth (which is not known, probably it is possible to use the sum over i,j of x[i,j,v]).
There is another problem. In my brute-force solution, the tours are disjoint (except vertex 1, of course). I don't have an example where nondisjoint tours lead to a better solution.

 

@Carl Love 

When running your worksheet I obtain other results. Please check.
Note also that " Check and ENFORCE triangle inequality " does not work this way.

@Carl Love You forgot op:
factor(op(1, convert(cos(Pi/257), RootOf)), sqrt(257));

@Kitonum 

Sure.
Note that in fact (-1)^(1/7) is itself a radical, so, if we want a simple cos(Pi/7)  we may use ( (-1)^(1/7) + 1/(-1)^(1/7) )/2.

@Kitonum 

Actually,

@Stretto 

(3^3)%/3;   is displayed  27/3  when interface(typesetting=standard);
Probably you have an older Maple version where interface(typesetting=standard) is the default.

But you should consider the fact that, unlike LaTeX, Maple is not a typesetting program. Maple offers some minimal options (note the inert operators %xxx were introduced mainly for other purposes) in this direction, but in general a user  wants correct results rather than special appearence. Not to mention that there are so many possibilities ...

BTW, most people will avoid a/b*c (in maths) and write  (a/b)*c. Maple does not care, it will return the "native" form.

 

@Kitonum 

It's shorter because you have not started from the integral, so, no need for IntegrationTools.

Actually I find the last of my favorites not so bad. It is rather compact:

P.S. The D notation should be natural for a mathematician. It is used by Dieudonné/Bourbaki.
But of course, De gustibus (et coloribus) non disputandum.

@mmcdara 

I'd prefer to see   instead of

Or, maybe   or 

@Carl Love 

For the body of a module the documentation is not clear enough. It seems that the assignments to locals are always executed here.
For example, if in Rand the ModuleLoad is removed, it works the same from library or directly.

Just want to add that the final answer can be simplified a bit, but unfortunately Maple needs a litte help for this:

simplify(eval(ans, t=2*ln(z))):
ANS:=simplify(eval(%, z=exp(t/2)));

 

@Kitonum 

Of course, a more "artistic" version is welcome.

First 41 42 43 44 45 46 47 Last Page 43 of 166