Markiyan Hirnyk

Markiyan Hirnyk
9 years, 32 days


These are answers submitted by Markiyan Hirnyk

The cites from ?subs

"

The first form of the subs command substitutes a for x in the expression expr. Note that this command is similar to the eval command. Simple applications of replacing a symbol by a value in a formula should normally be done with the eval command. Differences between the two commands are highlighted in the examples below"

"Since Maple does simultaneous substitution in all parameters, the following call to subs will return an error. (However, eval will work correctly.)
p := piecewise(x = 0, 1, sin(x)/x);

subs(x = 0, p);
Error, numeric exception: division by zero
eval(p, x = 0);
1 "

Two parameters

December 15 2014 Markiyan Hirnyk 6258

In fact, the solution set of the system

eqn1 := (1/8)*x/((x+y+z)^2+1)+(1/8)*x/((x+y)^2+1)+(1/8)*x/((x+z)^2+1)+(1/8)*x/(x^2+1)-(1/8)*y/((x+y+z)^2+1)-(1/8)*y/((x+y)^2+1)-(1/8)*y/((y+z)^2+1)-(1/8)*y/(y^2+1):

eqn2 := (1/((x+y+z)^2+1)-x*(2*x+2*y+2*z)/((x+y+z)^2+1)^2+1/((x+y)^2+1)-x*(2*x+2*y)/((x+y)^2+1)^2+1/((x+z)^2+1)-x*(2*x+2*z)/((x+z)^2+1)^2+1/(x^2+1)-2*x^2/(x^2+1)^2)(-(3/2*(2*x+2*y+2*z))/(x^2+2*x*y+2*x*z+y^2+2*y*z+z^2+1)^(5/2)-(3/2*(2*x+2*y))/(x^2+2*x*y+y^2+1)^(5/2)-(3/2*(2*y+2*z))/(y^2+2*y*z+z^2+1)^(5/2)-3*y/(y^2+1)^(5/2))-(1/((x+y+z)^2+1)-y*(2*x+2*y+2*z)/((x+y+z)^2+1)^2+1/((x+y)^2+1)-y*(2*x+2*y)/((x+y)^2+1)^2+1/((y+z)^2+1)-y*(2*y+2*z)/((y+z)^2+1)^2+1/(y^2+1)-2*y^2/(y^2+1)^2)(-(3/2*(2*x+2*y+2*z))/(x^2+2*x*y+2*x*z+y^2+2*y*z+z^2+1)^(5/2)-(3/2*(2*x+2*y))/(x^2+2*x*y+y^2+1)^(5/2)-(3/2*(2*x+2*z))/(x^2+2*x*z+z^2+1)^(5/2)-3*x/(x^2+1)^(5/2)):

depends on the two parameters {x=y,y=y,z=z}.

Here are my arguments.

and

eval([eqn1, eqn2], x = y);

                             [0, 0]

Likely new feature

December 08 2014 Markiyan Hirnyk 6258

The command

plot(x, x = 0 .. 1, axis[1] = [thickness = 4, tickmarks = [5, subticks = 5]])

does not work in Maple 13.02, producing the same error, but the one works in Maple 16.02 and Maple 18.02.

The thickness option in axis seems to  be introduced between Maple 13 and Maple 16.

Example

December 08 2014 Markiyan Hirnyk 6258

As usually, your question is dirtily formulated. If I understand it correctly, then, up to Wiki article http://en.wikipedia.org/wiki/Hilbert–Poincaré_series

poincare series=Hilbert-Poincare series. Here is an example.

 

with(Groebner):``

K := [x^3+y^3+z^3]:

HilbertSeries(K, s)``

(s^2+s+1)/(-1+s)^2

(1)

HilbertSeries(L, s)

(s+1)/(-1+s)^2

(2)

``

 

Download HPSexample.mw

 

1. You asked "Why do the following commands not achieve this?" The execution of

restart; printlevel := 10:

 with(LinearAlgebra):                                                                                                                                          A := Matrix([[a, b], [c, d]]):                                                                                                                                Eigenvalues(A) assuming a::integer,b::integer,c::integer,d::integer,a+b=d+c;

outputs

Vector[column](2, {1 = (1/2)*d+(1/2)*a+(1/2)*(a^2-2*a*d+4*b*c+d^2)^(1/2), 2 = (1/2)*d+(1/2)*a-(1/2)*(a^2-2*a*d+4*b*c+d^2)^(1/2)}, datatype = anything, storage = rectangular, order = Fortran_order, shape = []),

showing at that the Eigenvalues command  does not take into account any assumptions.      

2. You asked "How might I achieve what I need?"

This can be done as follows.

restart; with(LinearAlgebra):

A := Matrix([[a, b], [c, d]]):

Eigenvalues(simplify(A, {a+b = d+c}));

 Vector(2, {(1) = d+c, (2) = -c+a})

Eigenvalues_under_assumptions.mw                                                   

                                                                                                                                  

Zero

December 06 2014 Markiyan Hirnyk 6258

The default characteristic in Groebner:-HilbertSeries equals zero though this is not written in Maple help to the one

"The optional argument characteristic=p specifies the ring characteristic when J is a list or set. This option has no effect when J is a PolynomialIdeal or when X is a MonomialOrder".

This is clear from the example


with(Groebner):

F := [7*x^31-x^6-12*x-y, -4*x^8-z, 9*x^10-t]

[7*x^31-x^6-12*x-y, -4*x^8-z, 9*x^10-t]

(1)

h := HilbertSeries(F, {t, x, y, z}, s)

(s^6-2*s^5-11*s^4-9*s^3-6*s^2-3*s-1)/(-1+s)

(2)

g := HilbertSeries(F, {t, x, y, z}, s, characteristic = 3)

-(s^9+2*s^8+3*s^7+5*s^6+5*s^5+5*s^4+4*s^3+3*s^2+2*s+1)/(-1+s)

(3)

k := `mod`(HilbertSeries(F, {t, x, y, z}, s, characteristic = 3), 3)

2*(s^9+2*s^8+2*s^6+2*s^5+2*s^4+s^3+2*s+1)/(2+s)

(4)

``

``

``

``

``

``

``

``

``

``

``

``


Download HS.mw

False

December 01 2014 Markiyan Hirnyk 6258

Here are three approaches to detect that:

1.

        false

2.

3.

 

You can obtain info about these commands by typing and executing in your worksheet ?command, for example, ?minimize .

In two steps

November 30 2014 Markiyan Hirnyk 6258

This can be done as follows.

>restart; S := select(isprime, [`$`(41 .. 107)]);

[41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107]

>seq([s, msolve(y^2+y-11 = 0, s)], s = S);

[41, {y = 21}, {y = 19}], [43], [47], [53], [59, {y = 17}, {y = 41}], [61, {y = 8}, {y = 52}], [67], [71, {y = 25}, {y = 45}], [73], [79, {y = 9}, {y = 69}], [83], [89, {y = 28}, {y = 60}], [97], [101, {y = 33}, {y = 67}], [103],[107]

 

If you don't insist on the condition mu=1, then this can be done as follows.




Download truncnormal.mw

Two such solutions

November 27 2014 Markiyan Hirnyk 6258

This is a polynomial system.

The command

sol := SolveTools:-PolynomialSystem([eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9]);

produces 11 solutions

{C = 0, C1 = 0, C2 = 0, CT1 = 0, CT2 = 0, H = 0, N = 13568634100, S = 13568634100, T = 0}, {C = 0, C1 = 0, C2 = 0, CT1 = 0, CT2 = 0, H = 0, N = 759843509600/3, S = 13568634100, T = 719137607300/3}

evalf(allvalues(sol[3]));


{ C = 0., C1 = 0., C2 = 0., CT1 = 0., CT2 = 0.,
H = 8.997525450 10 ^8, N = -2.177035322 10^9 ,S = -3.076787867 10^9 , T = 0. },

{C = 0., C1 = 0., C2 = 0., CT1 = 0., CT2 = 0., H = -21.4, N = 0., S = 21., T = 0.}

 evalf([allvalues(sol[4])]);

[{C = 0.4016686283e-5, C1 = 7.763351747*10^(-7), C2 = 2.559699025*10^(-8), CT1 = 0.2192318136e-4, CT2 = 0.6778938028e-4, H = -21.39046966, N = -4.414100415*10^(-7), S = 21.39037853, T = -0.383729213e-5}, {C = 2.587564748*10^5, C1 = 50011.81048, C2 = 1648.967954, CT1 = 1.412299773*10^6, CT2 = 4.367017944*10^6, H = -3.104160511*10^5, N = -0.6400441387e-2, S = -5.520562453*10^6, T = -2.587564709*10^5}, {C = -6.661616045*10^8+5.594479407*10^9*I, C1 = -1.287540647*10^8+1.081287121*10^9*I, C2 = -4.245223772*10^6+3.565173497*10^7*I, CT1 = -3.635927887*10^9+3.053481851*10^10*I, CT2 = -1.124277057*10^10+9.441770288*10^10*I, H = 1.692752581*10^7+1.89105946*10^8*I, N = -2.898411*10^9+5.733634*10^9*I, S = 1.450891261*10^10+3.70503077*10^8*I, T = 3.27378704*10^9-1.115099343*10^11*I}, {C = -3.249597739*10^7+32880.99175*I, C1 = -6.280742012*10^6+6355.156634*I, C2 = -2.070859305*10^5+209.5394975*I, CT1 = -1.773639153*10^8+1.794653340*10^5*I, CT2 = -5.484327164*10^8+5.549305813*10^5*I, H = 7.327802307*10^8+3.340291721*10^6*I, N = 8.1853130*10^6-4.139898531*10^7*I, S = 1.219890148*10^7-6.180017090*10^7*I, T = 2.79866289*10^7+1.628705232*10^7*I}, {C = -18.70107687, C1 = -3.614497813, C2 = -.1191756709, CT1 = -102.0709787, CT2 = -315.6169844, H = 1.04437616, N = 2.15514615*10^(-8), S = -1.04437615, T = 440.1227134}, {C = -3.249597739*10^7-32880.99175*I, C1 = -6.280742012*10^6-6355.156634*I, C2 = -2.070859305*10^5-209.5394975*I, CT1 = -1.773639153*10^8-1.794653340*10^5*I, CT2 = -5.484327164*10^8-5.549305813*10^5*I, H = 7.327802307*10^8-3.340291721*10^6*I, N = 8.1853130*10^6+4.139898531*10^7*I, S = 1.219890148*10^7+6.180017090*10^7*I, T = 2.79866289*10^7-1.628705232*10^7*I}, {C = -6.661616045*10^8-5.594479407*10^9*I, C1 = -1.287540647*10^8-1.081287121*10^9*I, C2 = -4.245223772*10^6-3.565173497*10^7*I, CT1 = -3.635927887*10^9-3.053481851*10^10*I, CT2 = -1.124277057*10^10-9.441770288*10^10*I, H = 1.692752581*10^7-1.89105946*10^8*I, N = -2.898411*10^9-5.733634*10^9*I, S = 1.450891261*10^10-3.70503077*10^8*I, T = 3.27378704*10^9+1.115099343*10^11*I}]

There is no nonnegative solution among sol[3] and sol[4].

See PS.mw

Making two plots

November 24 2014 Markiyan Hirnyk 6258

This can be done as follows.



Download twoplots.mw

There is no problem here in Maple 18.02:

Converting to sets

November 23 2014 Markiyan Hirnyk 6258

This can be done as follows.

L1 := [(diff(y(x), x))*(diff(y(x), x, x)), diff(y(x), x, x, x), (diff(y(x), x, x))^2, diff(y(x), x, x, x), diff(y(x), x, x, x)]:

L2 := [(diff(y(x), x))*(diff(y(x), x, x)), diff(y(x), x, x, x), diff(y(x), x), (diff(y(x), x, x))^2, diff(y(x), x, x)]:

S1 := convert(L1, set):

S2 := convert(L2, set):


 S1 subset S2;

true

S2 subset S1

false

N:=6:

plot(s,l=-20..100);

plot(s,l=40..60);

plot_to_Shklovski.mw

This works for me

November 21 2014 Markiyan Hirnyk 6258

You redifine M and the second definition

M := [[x*y,y,x],[x^2+x,y+x^2,y],[-y,x,y],[x^2,x,y]];

is not correct. Compare with http://www.maplesoft.com/support/help/Maple/view.aspx?path=Groebner/Basis_details

(Maybe, a typo is made.).

This works for me.

restart; with(Groebner):

F := [x+y+z, x*y+x*z+y*z, x*y*z-1];

M := [seq(s^3*F[i]+s^(3-i), i = 1 .. 3)];

with(Ore_algebra): A := poly_algebra(x, y, z, s);

T := MonomialOrder(A, lexdeg([s], [x, y, z]), {s});

G := Groebner[Basis](M, T);

[s*x*y*z-x*y-x*z-y*z-s, s^2*x*y+s^2*x*z+s^2*y*z-s*x-s*y-s*z, s^2*x*z^2+s^2*y*z^2-s*x*z-s*y*z-s*z^2+s^2+x+y+z, s^2*y^2*z^2-s*y^2*z-s*y*z^2+s^2*y+s^2*z+y^2+y*z+z^2-s, s^3*x+s^3*y+s^3*z+s^2, s^3*y^2+s^3*y*z+s^3*z^2+s^2*y+s^2*z-s, s^3*z^3+s^2*z^2-s^3-s*z+1]

 

Download basis.mw

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