vv

13977 Reputation

20 Badges

10 years, 37 days

MaplePrimes Activity


These are replies submitted by vv

@ajfriedlan 

The answer to your question is simple, given by some elementary numerical analysis principles. Your numerical expressions have very wide ranges (10^(-20) .. 10^40). To compensate the roundoff errors you will need very high precision. But normally, your parameters should also have good precision, otherwise the result will be mainly numerical noise. 

You should normalize/scale the expressions and try to simplify symbolically first.

@Ugurgozutok 

The procedure works for several variables, we just need to choose the main one (x); the degree n in x must be even.
Note however that if the leading coefficient wrt x depends on other variables, then the result will be generally a rational function rather than a polynomial. This is natural, for example, x^2*y^2 + x^2 + y^2 obviously cannot be expressed as (a(y)*x+b(y))^2 + c(y)*x+d(y), a,...,d being polynomials.

 

@saketh 

It is of course possible (and easy) to find the polynomial solution directly, but I doubt about a better timing (the number of terms in the polynomial will be huge).

Does the program work in a console? If yes, then make a .bat (.cmd) file and call this with ssystem.

@Ugurgozutok 

I don't quite understand the style of your questions. It is neither mathematics (no context, no proper notations etc) nor Maple (not a single line of code). For example, when computing gcd (or need irreducibility as in your other thread) the exact ring for your polynomials is essential.

@Ugurgozutok 

As I have mentioned, the problem is delicate in general and not fully stated (you gave 0 details). The linearity in d in my example is not important, but d in Z is essential. If your polynomial p is in R[x,y] and the degree is just 20, the chances for a solution are about 0% (even if p is linear in d).

@Carl Love 

It will be difficult to shrink it further. Vote up.

@nm 

Yes, I know that Mathematica knows better than the user what the user wants. But you must admit that a rule is necessary in order to choose correctly. I hope that the rule is other than "accept what mma does".

It don't see a simple and general solution here. Your line cannot be parsed in Maple due to embedded double quotes (without "\").
There is an inherent ambiguity, without "rules". For example, the line:

1,2,3,"x+y, algorithm=[",123,"]","OK",5

can be interpreted as having 6 or 8 fields.

For a solution (assuming the rules are made clear)  a dedicated parser must be programmed. Or, regular expressions.

If the user has an international keyboard, the foreign characters are obtained without problem (they use the UTF-8 encoding)  for symbols and strings.

In Windows, an easy way to obtain the missing characters is using Windows'  charmap.exe

But at least for Maple<2020, StringTools does not support non-Ascii.

 

The complex roots are the roots of the polynomyal in lambda

P:=(lambda,t) -> 1+1/3*lambda+1/18*lambda^2-1/324*lambda^3+1/1944*lambda^4 - exp(I*t)

for t in [0,2*Pi)
A sequence of 40 random roots are obtained with:

r:=rand(0..2.*Pi):
seq(fsolve(P(lambda,r()),complex), 1..10);

 

@Carl Love

Carl, it's not only about 1/4 versus 1/2 line. But I think that a beginner will be intimidated by the "1/2" - one.

I definitely like your coding style, but when the question comes from a beginner, an "elementary" version should be added (a fortiori if it's 1/4).

@Carl Love 

Isn't this overkill? Why not simply

`&||` := (x,y) -> 1/(1/x+1/y);

if we use it only as operator (not as function `&||`(a,b,...)).

@Carl Love 

M:= f(output((J:= Iterator:-Combination(6,4))), 0, [2,2]):
(in J do M+~1 od);

f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1

@Carl Love 

Do you mean that in your code Alias is invoked only once? It creates a 2x2 Matrix.

(Actually I am a little afraid of what Alias does and try to avoid it).

First 49 50 51 52 53 54 55 Last Page 51 of 177