Markiyan Hirnyk

Markiyan Hirnyk
9 years, 255 days


These are answers submitted by Markiyan Hirnyk

[seq(degree(3*x*y^2, c), c = indets(3*x*y^2, name))];

                             [1, 2]

Not reinventing the wheel,

restart;

with(geom3d): with(plots):

TruncatedIcosahedron(football, point(C, 0, 0, 0), 1):

draw(football);

The DirectSearch package should be downloaded from http://www.maplesoft.com/applications/view.aspx?SID=101333 and installed in your Maple.

 

P := a^3*b-a^3*c+a^3*x+a^3*y+a^3*z-a^2*b*x+a^2*b*y+a^2*c*x-a^2*c*y-a^2*x^2-a^2*x*z+a^2*y^2+a^2*y*z-a*b*c*x-a*b*c*z-a*c*x^2-a*c*x*z+b^2*c^2+2*b*c^2*x+c^2*x^2-b^2*c-2*b*c*x-c*x^2:

DirectSearch:-GlobalOptima(P, {a >= b+x, c <= b+y}, assume = nonnegative);``

[HFloat(-6720.414058257804), [a = HFloat(173.89936592444127), b = HFloat(0.3331177370630053), c = HFloat(0.3333525973166548), x = HFloat(173.56624818737828), y = HFloat(2.3486025364971125e-4), z = HFloat(425.1897337859367)], 1184]

(1)

Because DirectSearch works with non-strict inequalities only (as well as Optimization). Let us somewhat increase a and y to obtain the strict inequalities:

eval(P, [a = 173.899365925, b = .333117737063005, c = .333352597316655, x = 173.566248187378, y = 0.2348602536498e-3, z = 425.189733785937]);

-6719.257626

(2)

``

Download nonpositivity.mw

PS. See the polynomial I worked with in screen25.07.15.docx

 

The Tolerances package is not enough strong to this end. All that can be done with the ScientificErrorAnalysis package which is much more powerful.

See ?ScientificErrorAnalysis for info. The roots in your example are complex numbers. That circumstance somewhat complicates the matter:

restart; sol := solve(a*x^2+b*x+c = 0, x): with(ScientificErrorAnalysis):
a := Quantity(3., 1.0):
b := Quantity(2., 1.0);
c := Quantity(2., 1.0);
combine(sol[1], errors);



combine(sol[2], errors);

#

#
b := Quantity(6., 1.0);
c := Quantity(2., 1.0);
combine(sol[1], errors);

combine(sol[2], errors);
Quantity(-1.577350269, 0.8980695230)
Hope you will be able to understand why the above errors differ. Don't hesitate to ask for further explanation in need.

We see  better results than Mathematica produces.

Q&E.mw

Edit. One sentence was deleted.

 

Start

July 13 2015 Markiyan Hirnyk 6549

Not being a specialist in ODEs, I can only guess roundoff errors cause that.

If you add method=classical[foreuler], then the command

works well:

 

Some results

July 06 2015 Markiyan Hirnyk 6549

First of all, the variable 'gamma' should be proclaimed local because this is the protected name for the Euler constant in Maple. Making use of the SolveEquations command of the DirectSearch package (the one should be downloaded from http://www.maplesoft.com/applications/view.aspx?SID=101333 and installed in your Maple >=12),  I obtain the solution of the problem in your SOL2. Likely your problem in SOL3 has no real solution. However, enlarging the range of M to M = 0.4e-1 .. .6, I obtain its real solution. It should be noticed that fsolve does not solve that.

See the outputs in parametrical_system.mw

Your unbased claims concerning the solutions in MATLAB are empty words.

By eliminate

June 29 2015 Markiyan Hirnyk 6549

This can be done as follows.

 

X := proc (theta) options operator, arrow; cos(theta)+0.8e-1*cos(3.*theta) end proc:

plot([X, Y, 0 .. 2*Pi])

 

X = convert(cos(theta)+(.8*(1/10))*cos(3.*theta), rational)

X = cos(theta)+(2/25)*cos(3*theta)

(1)

Y = convert(-sin(theta)+0.8e-1*sin(3.*theta), rational)

Y = -sin(theta)+(2/25)*sin(3*theta)

(2)

eliminate({X = cos(theta)+(2/25)*cos(3*theta), Y = -sin(theta)+(2/25)*sin(3*theta)}, theta)

[{theta = Pi-arccos((1/24)*(2700*X+6*(202500*X^2+41154)^(1/2))^(1/3)-(19/4)/(2700*X+6*(202500*X^2+41154)^(1/2))^(1/3)+((1/2)*I)*3^(1/2)*((1/12)*(2700*X+6*(202500*X^2+41154)^(1/2))^(1/3)+(19/2)/(2700*X+6*(202500*X^2+41154)^(1/2))^(1/3)))}, {-I*(-(-2*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+(2*I)*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)-1488*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-25992-(25992*I)*3^(1/2))/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)+(-(-2*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+(2*I)*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)-1488*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-25992-(25992*I)*3^(1/2))/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+1428*(-(-2*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+(2*I)*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)-1488*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-25992-(25992*I)*3^(1/2))/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)+(12996*I)*(-(-2*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+(2*I)*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)-1488*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-25992-(25992*I)*3^(1/2))/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)*3^(1/2)+21600*Y*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)+12996*(-(-2*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+(2*I)*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)-1488*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-25992-(25992*I)*3^(1/2))/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)}], [{theta = arccos((1/12)*(2700*X+6*(202500*X^2+41154)^(1/2))^(1/3)-(19/2)/(2700*X+6*(202500*X^2+41154)^(1/2))^(1/3))}, {-(-((2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)-372*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)+12996)/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+714*(-((2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)-372*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)+12996)/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)+5400*Y*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-12996*(-((2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)-372*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)+12996)/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)}], [{theta = arccos(-(1/24)*(2700*X+6*(202500*X^2+41154)^(1/2))^(1/3)+(19/4)/(2700*X+6*(202500*X^2+41154)^(1/2))^(1/3)+((1/2)*I)*3^(1/2)*((1/12)*(2700*X+6*(202500*X^2+41154)^(1/2))^(1/3)+(19/2)/(2700*X+6*(202500*X^2+41154)^(1/2))^(1/3)))}, {I*2^(1/2)*((I*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)+(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+744*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-(12996*I)*3^(1/2)+12996)/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)+2^(1/2)*((I*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)+(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+744*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-(12996*I)*3^(1/2)+12996)/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+1428*2^(1/2)*((I*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)+(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+744*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-(12996*I)*3^(1/2)+12996)/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-(12996*I)*2^(1/2)*((I*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)+(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+744*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-(12996*I)*3^(1/2)+12996)/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)*3^(1/2)+21600*Y*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)+12996*2^(1/2)*((I*(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)*3^(1/2)+(2700*X+6*(202500*X^2+41154)^(1/2))^(4/3)+744*(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3)-(12996*I)*3^(1/2)+12996)/(2700*X+6*(202500*X^2+41154)^(1/2))^(2/3))^(1/2)}]

(3)

``

 

Download another_way.mw

 

 

Yes, there is

June 26 2015 Markiyan Hirnyk 6549

Any edition of Maple 18 includes the Calculus palette:

 

This is explained in ?examples,RegularChains, but it is not an easy reading. Here is a cite:


restart;
with(RegularChains);
with(ChainTools);
with(MatrixTools);
with(ConstructibleSetTools);
with(ParametricSystemTools);
with(SemiAlgebraicSetTools);
with(FastArithmeticTools);
Cylindrical Algebraic Decomposition (CAD) is a fundamental and powerful tool for  studying systems of equations, inequations and inequalities.

Our algorithm is different from the traditional algorithm of Collins. It first computes a cylindrical decomposition of the complex space, from which a CAD of the real space can be easily extracted.
 Consider the hyperbola xy-1 = 0.

 

R := PolynomialRing([y, x]);
F := [y*x-1];

polynomial_ring

 

[x*y-1]

(1)

NULL

A cylindrical algebraic decomposition adapted to the polynomial xy-1can be computed  by the command CylindricalAlgebraicDecompose  as follows:

outcad := CylindricalAlgebraicDecompose(F, R);

outcad := piecewise(x < 0, piecewise(y < 1/x, [regular_chain, [[-1, -1], [-2, -2]]], y = 1/x, [regular_chain, [[-1, -1], [-1, -1]]], 1/x < y, [regular_chain, [[-1, -1], [0, 0]]]), x = 0, [regular_chain, [[0, 0], [0, 0]]], 0 < x, piecewise(y < 1/x, [regular_chain, [[1, 1], [0, 0]]], y = 1/x, [regular_chain, [[1, 1], [1, 1]]], 1/x < y, [regular_chain, [[1, 1], [2, 2]]]))

(2)

The output CAD is described by a nested piecewise function. The outmost piecewise function is a function with three conditions x < 0, x = 0, and 0 < x.
Each of the conditions has a corresponding expression, which is again a piecewise function.  The output could be read from top to bottom and from right to left.

One can see that the CAD consists of seven cells.

For example, x < 0 and y < 1/xdescribes one cell of the CAD, where [regular_chain, [[-1, -1], [-2, -2]]]

represents a sample point in this cell.

This sample point is represented by a regular chain and an isolating box such that inside this box there is one and only one root of this regular chain.

We plot the hyperbola and all the sample points of the CAD adapted to this hyperbola  as follows.

with(plots);sp := [[-1, -2], [-1, -1], [-1, 0], [0, 0], [1, 0], [1, 1], [1, 2]];points := pointplot(sp, color = blue);curve := implicitplot([x*y-1, x], x = -5 .. 5, y = -5 .. 5, color = [red, black]);display([curve, points]);

 

 

``


Download Explanation.mw

 

Assignment

June 24 2015 Markiyan Hirnyk 6549

Use alpha := 30 instead of alpha = 30 at the end of the first section and obtain

NLPSolve(-2*DD*alpha2+2*beta1*xi+phi-360, beta = 0.1e-2 .. 90);

[HFloat(97.53974372837894), [beta = HFloat(1.4386902307471268)]]

I did not see your code after that place.

The DirectSearch package should be downloaded from http://www.maplesoft.com/applications/view.aspx?SID=101333 and installed in your Maple

restart:

A := 18*9^(x^2+2*x)+768*4^((x+3)*(x-1))-5*6^((x+1)^2):

DirectSearch:-SolveEquations(A = 0, AllSolutions, solutions = 4);

The output suggests the solutions are integers in fact. Indeed,


DirectSearch:-SolveEquations(A = 0, AllSolutions, assume = integer, solutions = 4);

Let us draw the plot of A:

plot(A, x = -2.1 .. .1);

In order to solve the inequality A>=0, one can apply this theorem.

This can be done in such a way.

SOL1 := solve(identity(res = 0, r), {a, c, n, phi[0]});

My explanation is the following guess (I don't find it in Maple Help to the solve command.). When unknowns are defined as a list of names, then the order of unknowns in the solution is also determined.  If unknowns are written as a set, then the order of the unknowns in the solution is not predetermined.       

By Analytic

June 18 2015 Markiyan Hirnyk 6549

Both real and complex solutions can be found in such a way:

Digits:=100:RootFinding:-Analytic(cos(x)*cosh(x)-1, x = 0-.1*I .. 15+.1*I);

    

RootFinding:-Analytic(cos(x)*cosh(x)-1, x = 0-7*I .. 15+7*I);

 

See ?Analytic for info.

Edit: Digits:=100 added.

Answer is no

June 17 2015 Markiyan Hirnyk 6549

There is no equivalent of the Mathematica's FindInstance   command in Maple. However, Maple solves inequalities. Can you present your concrete problem in MaplePrimes?

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