Markiyan Hirnyk

Markiyan Hirnyk
8 years, 286 days


These are answers submitted by Markiyan Hirnyk

Putting q(x,t)=1000, we obtain a system of three equations in three unknown functions. Big coefficients make a difficulty so we decrease these and increase Digits.



 

 

Long outputs which are displayed in the attaced file.

Hope you consider the other cases on your own.

Download system.mw

By weights option

August 30 2014 Markiyan Hirnyk 6063
3 3

According to Wiki, this can be done by the Statistics:-Fit command with the weights option. Compare the two outputs in

 

with(Statistics):

``

X := Vector([1, 2, 3, 4, 5, 6], datatype = float):

``

Y := Vector([2, 3, 4.8, 10.2, 15.6, 30.9], datatype = float):

``

W := [1, 1, 4.7, 5.3, 1, 1]

[1, 1, 4.7, 5.3, 1, 1]

(1)

``

Fit a model that is linear in the parameters without weights and with these.

Fit(a+b*t+c*RealDomain:-`^`(t, 2), X, Y, t)

HFloat(6.629999999999995)-HFloat(5.374642857142857)*t+HFloat(1.5339285714285715)*t^2

(2)

``

Fit(a+b*t+c*RealDomain:-`^`(t, 2), X, Y, t, weights = W)

HFloat(6.082489667949227)-HFloat(4.8416798489382735)*t+HFloat(1.4586222744762694)*t^2

(3)

``

``

``

PS.  High theories  concerning GLS should be programmed in Maple.

Download weights.mw

Infinity

August 28 2014 Markiyan Hirnyk 6063
0 4

Making a few changes in your code, namely

- loglik:=f0*ln(IntegrationTools:-Combine(expand(data.(pj)/f0)));
above:=lnGAMMA(N+1):


- loglik:=unapply(above-below+loglik,f0,mu,sigma);

- pj := seq(binomial(K, j)*(evalf(Int((1-1/(1+exp(-x)))^(K-j)*exp(-(x-mu)^2/(2*sigma^2))/((1+exp(-x))^j*sigma*sqrt(2*Pi)), x = -infinity .. infinity))), j = 0 .. K);,

and using

DirectSearch[Search]('loglik(f0,mu,sigma)',{f0>=0,sigma>=0,mu<=0,mu>=-50,f0<=50,sigma<=50},maximize);

I obtain

test1.mw

 

This can be done by the LeastSquare command with the optimize option. Here is an example.

 

NULL

NULL

NULL

restart; with(LinearAlgebra)``

A := Matrix([[1, 2, 3], [1, 2.0000000000001, 3], [-1, 2, 4]])

Matrix([[1, 2, 3], [1, 2.0000000000001, 3], [-1, 2, 4]])

(1)

B := Vector([2, 2, 5])

Vector[column]([[2], [2], [5]])

(2)

LeastSquares(A, B, optimize)

Vector[column]([[-1.05797101449275], [.202898550724619], [.884057971014502]])

(3)

sys := GenerateEquations(A, [x, y, z], B)

[x+2*y+3*z = 2, x+2.0000000000001*y+3*z = 2, -x+2*y+4*z = 5]

(4)

eval(sys, [x = -1.05797101449275, y = .202898550724619, z = .884057971014502])

[2.000000000 = 2, 2.000000000 = 2, 4.999999999 = 5]

(5)

C := Matrix([[1, 2, 3], [1, 2, 3], [-1, 2, 4]])

Matrix([[1, 2, 3], [1, 2, 3], [-1, 2, 4]])

(6)

sol := LinearSolve(C, B)

Vector[column]([[-3/2+(1/2)*_t0[3]], [7/4-(7/4)*_t0[3]], [_t0[3]]])

(7)

eval(sol, _t0[3] = .884057971014502)

Vector[column]([[-1.057971014], [.202898551], [.884057971014502]])

(8)

``

 

Download LeastSquares.mw

 

MultiSeries:-limit(sqrt(-2*cos(alpha)*cos(alpha+d)+2-2*sin(alpha+d)*sin(alpha))/d, d = 0, right) assuming alpha::real;

MultiSeries:-limit(sqrt(-2*cos(alpha)*cos(alpha+d)+2-2*sin(alpha+d)*sin(alpha))/d, d = 0, left) assuming alpha::real;

The simplification of these is omitted.

By ArrayTools

August 25 2014 Markiyan Hirnyk 6063
1 0

For example, this can be done as follows

A := Matrix([[1, 2, 3], [4, 5, -1]]):
B := map(c -> if 3 <= c then c else 0 end if , A);

row, col := ArrayTools:-SearchArray(B);

convert(<row| col>, listlist);
                    [[2, 1], [2, 2], [1, 3]]

 



 

This can be done in Standard, Document Mode by  switching between Text and Math in ToolBar. Here is an example:

TextMath.mw

PS. and TextMath2.mw

See ?Working in Document Mode for more info.

There may be difficulties with some formulas in differential geometry.

 




Yes, it is possible

August 23 2014 Markiyan Hirnyk 6063
0 1

It is well known that the golden ratio phi=(sqrt(5)+1)/2 so

1.6180339887498948482

You can add phi to constants in such a way

constants := constants, phi

By insequence=true option

August 23 2014 Markiyan Hirnyk 6063
2 0

This can be done in such a way.

restart; with(Statistics): with(plots):
 P := lambda ->RandomVariable(Poisson(lambda)):
 display([seq(DensityPlot(P(n), range = 0 .. 10), n = 1 .. 5)], insequence = true);

Comparison

August 22 2014 Markiyan Hirnyk 6063
0 2

See

 

restart; with(CodeTools); Usage(plot(map(proc (i) options operator, arrow; i*sin(t) end proc, [seq(i, i = .1 .. 1, .2)]), t = -2*Pi .. 2*Pi))

memory used=2.99MiB, alloc change=32.00MiB, cpu time=124.00ms, real time=301.00ms, gc time=0ns

 

Usage(plot([seq(i*sin(t), i = .1 .. 1, .2)], t = -2*Pi .. 2*Pi));

memory used=1.14MiB, alloc change=0 bytes, cpu time=47.00ms, real time=41.00ms, gc time=0ns

 

``


to this end.

Download usage.mw

Order of commands

August 21 2014 Markiyan Hirnyk 6063
1 1

If you carefully read Maple Help, you will understand why this works

x;

x

Don't hesitate to ask for further explanation in need.

Under assumption

August 21 2014 Markiyan Hirnyk 6063
1 7

It is clear that the parameter z is positive. In view of it this works


restart; f := proc (t) options operator, arrow; piecewise(t < 0, 0, 0 <= t and t < z, t, z < t, z) end proc; r := convert(f(t), Heaviside)

r := `assuming`([inttrans[laplace](r, t, s)], [z > 0]);

(1-exp(-s*z))/s^2

(1)

NULL

NULL


Download LT.mw

Not reinventing the wheel,

August 17 2014 Markiyan Hirnyk 6063
3 1

this can be done as follows:

 

addcoords(affine, [x, y], [x-(1/2)*y, y])

Warning, not an orthogonal coordinate system - no scale factors calculated.

 

plots:-coordplot(affine, [-1 .. 1, -1 .. 1], axes = box, gridlines = false)

 

``

The image of [-1,1]x[-1,1] is displayed.

Download affine.mw

Here are my arguments.

 

restart

t := (cos(y)/sqrt(y^2+1)+I*sqrt(y^3+2)*sin(y))*BesselJ(0, y):NULL

plot([Re(t), Im(t)], y = 0 .. 10, view = [0 .. 10, -.1 .. .1], color = [blue, red])

 

 

 

RootFinding:-Analytic(t, re = 0 .. 10, im = -1 .. 1)

5.520078110, .5378363550+.6749359945*I, 9.424781460+0.3642288221e-2*I, 8.653727915, 6.283224045+0.9939802100e-2*I, 2.404825558, 3.143645495+0.5271012320e-1*I

(1)

DirectSearch:-SolveEquations([Re(eval(t, y = u+I*v)), Im(eval(t, y = u+I*v))], {u >= 0, v >= -1, u <= 10, v <= 1}, AllSolutions)

Matrix(7, 4, {(1, 1) = 0.1039502792e-25, (1, 2) = Vector(2, {(1) = HFloat(-9.533264822182746e-14), (2) = HFloat(-3.614850074426784e-14)}), (1, 3) = [u = 8.65372791291102, v = -0.1979993520e-13], (1, 4) = 82, (2, 1) = 0.1278977452e-25, (2, 2) = Vector(2, {(1) = HFloat(-1.0187983564929878e-13), (2) = HFloat(-4.9094537444784927e-14)}), (2, 3) = [u = 2.40482555769580, v = -0.7611829592e-13], (2, 4) = 90, (3, 1) = 0.7373586454e-25, (3, 2) = Vector(2, {(1) = HFloat(2.6305853196235286e-13), (2) = HFloat(-6.735037714109912e-14)}), (3, 3) = [u = 9.42478145908336, v = 0.364228821925537e-2], (3, 4) = 83, (4, 1) = 0.1496284254e-24, (4, 2) = Vector(2, {(1) = HFloat(3.782392021918967e-13), (2) = HFloat(8.10156237189513e-14)}), (4, 3) = [u = .537836355054287, v = .674935994442906], (4, 4) = 60, (5, 1) = 0.5718766083e-24, (5, 2) = Vector(2, {(1) = HFloat(7.546656323302453e-13), (2) = HFloat(-4.854267870843557e-14)}), (5, 3) = [u = 3.14364549478210, v = 0.527101232016948e-1], (5, 4) = 79, (6, 1) = 0.6236084378e-23, (6, 2) = Vector(2, {(1) = HFloat(2.0150338629103837e-12), (2) = HFloat(-1.4750331892844617e-12)}), (6, 3) = [u = 6.28322404368377, v = 0.993980209970338e-2], (6, 4) = 69, (7, 1) = 0.6101471069e-21, (7, 2) = Vector(2, {(1) = HFloat(2.39681750166319e-11), (2) = HFloat(-5.9727458767628956e-12)}), (7, 3) = [u = 5.52007811028837, v = 0.7782349966e-11], (7, 4) = 83})

(2)

 

NULL

 

Download roots.mw

You are right

August 14 2014 Markiyan Hirnyk 6063
0 0

Here is a proof (PS. i. e. a counterexample) done with Maple:

 

``

NULL

with(GroupTheory):

G := CyclicGroup(n)

GroupTheory:-CyclicGroup(n)

(1)

IsNilpotent(G);

                                true
                              true

(2)

H := DihedralGroup(8)

GroupTheory:-DihedralGroup(8, form = "permgroup")

(3)

IsNilpotent(H)

true

(4)

IsAbelian(H)

false

(5)

``


However, it should be noted the properties of CyclicGroup(n) are simply implemented in Maple.

Download NilpotentvsCyclic.mw

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