Markiyan Hirnyk

Markiyan Hirnyk
8 years, 336 days


These are answers submitted by Markiyan Hirnyk

Unfortunately, the NonlinearFit command does not produce standarderrors for a and b as yet, only LinearFit does it. You can reduce Te=exp(a*X+b) to the linear fit ln(Te)=a*X+b, following http://www.mapleprimes.com/questions/120014-How-To-Calculate-Coefficient-Of-Determination#answer120021.

Don't hurry

3 hours ago Markiyan Hirnyk 6148
1 2

The cite from Maple Help to VectorCalculus:-int :

"

To define how angle is measured for an Ellipse centered at the origin, we first define the right semimajor axis of the ellipse to be the semimajor axis in the right half-plane (the first and fourth quadrants of the plane). If the major axis of the ellipse is coincident with the y-axis, then its right semimajor axis is defined to be the one on the negative y-axis. Thus, for an ellipse centered at the origin with its major axis sitting on the line y = x, its right semimajor axis is the one inside the first quadrant.
For an Ellipse centered at the origin, angle is measured counterclockwise from its right semimajor axis. Therefore, in the example ellipse given in the previous paragraph, the angle
1
- Pi
4
specifies the positive y-axis"

By byteused

October 19 2014 Markiyan Hirnyk 6148
1 4

How about this?


with(CodeTools)``

a := ["just a string", 3.14, 123, x/y]

Usage(a, output = all)

`Non-fatal error while reading data from kernel.`

(1)

restart

with(CodeTools):NULL

d := array(1 .. 2, 1 .. 2, [(1, 1) = "just a string", (1, 2) = 3.14, (2, 1) = 123, (2, 2) = x/y])

Matrix(2, 2, {(1, 1) = "just a string", (1, 2) = 3.14, (2, 1) = 123, (2, 2) = x/y})

(2)

Usage(d, output = all)

Record(realtime = 0., cputime = 0., gctime = 0., gcrealtime = 0., bytesused = 1304, bytesalloc = 0, output = (Matrix(2, 2, {(1, 1) = "just a string", (1, 2) = 3.14, (2, 1) = 123, (2, 2) = x/y})))

(3)

restart``

with(CodeTools)

Usage(array(1 .. 2, 1 .. 2, [(1, 1) = "just a string", (1, 2) = 3.14, (2, 1) = 123, (2, 2) = x/y]), output = all)

Record(realtime = 0., cputime = 0., gctime = 0., gcrealtime = 0., bytesused = 2648, bytesalloc = 0, output = (Matrix(2, 2, {(1, 1) = "just a string", (1, 2) = 3.14, (2, 1) = 123, (2, 2) = x/y})))

(4)

``

``


Download byteused.mw

By DirectSearch

October 18 2014 Markiyan Hirnyk 6148
0 2

This can be done as follows (The DirectSearch package should be downloaded from  http://www.maplesoft.com/applications/view.aspx?SID=101333

and installed in your Maple.).

M := (A, B, w1, w2, theta) -> DirectSearch:-GlobalSearch(abs(A*sin(w1*t)+B*sin(w2*t+theta)), {t = -infinity .. infinity}, maximize, solutions = 1);

M(3, -4, 5, 5, .6);

Matrix(1, 3, {(1, 1) = 2.27858404325318, (1, 2) = [t = -97.9911631025769], (1, 3) = 16})

M(-3, -4, 5, 6.1, .6);

Matrix(1, 3, {(1, 1) = 6.99760903598980, (1, 2) = [t = 279.294098572198], (1, 3) = 21})

M(1, -1, 4, Pi, .6);

Matrix(1, 3, {(1, 1) = 1.99949182535559, (1, 2) = [t = -178.683005013318], (1, 3) = 17})

It should be noted that the amplitude equals max(abs(A+B), abs(A-B)) if  w1 <> r1*w2 or/and w2<>r2*w1, where r1, r2  are  rational numbers. This is proved in the almost periodic funtion theory.

The restart command in line 3

October 11 2014 Markiyan Hirnyk 6148
0 0

causes it. If you deleted restart;, then your code works. See restart for info.

By change

October 11 2014 Markiyan Hirnyk 6148
0 2

This can be done in such a way.


`f__2 x` := (x__1-x__2)*`&epsilon;`*(L__20-L__2)/L__2:

L__20 := sqrt(2):

L__2 := sqrt((x__1-x__2)^2+(y__1-y__2)^2):

`f__2 x`

(x__1-x__2)*`&epsilon;`*(2^(1/2)-((x__1-x__2)^2+(y__1-y__2)^2)^(1/2))/((x__1-x__2)^2+(y__1-y__2)^2)^(1/2)

(1)

A := eval(%, x__1 = t+x__2)

t*`&epsilon;`*(2^(1/2)-(t^2+(y__1-y__2)^2)^(1/2))/(t^2+(y__1-y__2)^2)^(1/2)

(2)

diff(A, t)

`&epsilon;`*(2^(1/2)-(t^2+(y__1-y__2)^2)^(1/2))/(t^2+(y__1-y__2)^2)^(1/2)-t^2*`&epsilon;`*(2^(1/2)-(t^2+(y__1-y__2)^2)^(1/2))/(t^2+(y__1-y__2)^2)^(3/2)-t^2*`&epsilon;`/(t^2+(y__1-y__2)^2)

(3)

eval(diff(A, t), t = x__1-x__2)

`&epsilon;`*(2^(1/2)-((x__1-x__2)^2+(y__1-y__2)^2)^(1/2))/((x__1-x__2)^2+(y__1-y__2)^2)^(1/2)-(x__1-x__2)^2*`&epsilon;`*(2^(1/2)-((x__1-x__2)^2+(y__1-y__2)^2)^(1/2))/((x__1-x__2)^2+(y__1-y__2)^2)^(3/2)-(x__1-x__2)^2*`&epsilon;`/((x__1-x__2)^2+(y__1-y__2)^2)

(4)

``


Download diff.mw

The answer done in Java

October 06 2014 Markiyan Hirnyk 6148
0 0

The CompGeom package done in Java is freely distributed from https://bitbucket.org/ihromant/compgeom. The one is also accessible here. The copyright belongs to Ivan Hetman. This works: I have just seen it in action here. It would be very useful to create ComputationalGeometry package in Maple.

Precedent

October 02 2014 Markiyan Hirnyk 6148
0 0

That was asked and answered many times. For example, see http://www.mapleprimes.com/questions/42349-Save-A-Worksheet-Session

Also try the "save", "result" "session" searches in MaplePrimes at the top of this page. Look at  save and around it.

Eureka

September 30 2014 Markiyan Hirnyk 6148
0 7

This summation can be found as follows.


restart; H := `assuming`([int(int(cos(2*k*Pi*x/a)*(1-cos(2*l*Pi*y/b))*(1-cos(2*m*Pi*x/a))*(1-cos(2*n*Pi*y/b)), y = 0 .. b, AllSolutions), x = 0 .. a, AllSolutions)], [k::posint, l::posint, m::posint, n::posint, m <= N, n <= N, a > 0, b > 0])

piecewise(l = n, piecewise(k = m, -(3/4)*b*a, 0), piecewise(k = m, -(1/2)*b*a, 0))

(1)

``

convert(H, Heaviside)

-(1/4)*a*b*Dirac(k-m)*Dirac(l-n)-(1/2)*a*b*Dirac(k-m)

(2)

L := `assuming`([int(convert(H, Heaviside), k = 0 .. N)], [k::posint, l::posint, m::posint, n::posint, m <= N, n <= N, a > 0, b > 0]);

(1-Heaviside(-N+m))*(-(1/4)*b*a*Dirac(n-l)-(1/2)*b*a)

(3)

 # the integral equals sum(convert(H, Heaviside), k = 1 .. N) by the definitions of Dirac and #Heaviside

`assuming`([int(L, l = 0 .. N)], [k::posint, l::posint, m::posint, n::posint, m <= N, n <= N, a > 0, b > 0]);

-(1/4)*(1-Heaviside(-N+m))*b*a*(1-Heaviside(-N+n)+2*N)

(4)

  # the integral equals sum(L, l = 1 .. N) by the definitions of Dirac and Heaviside

eval(%, [N = 7, m = 2, n = 6])

-(15/4)*b*a

(5)

`assuming`([int(int(eval(sum(sum(cos(2*k*Pi*x/a)*(1-cos(2*l*Pi*y/b))*(1-cos(2*m*Pi*x/a))*(1-cos(2*n*Pi*y/b)), k = 1 .. N), l = 1 .. N), [N = 7, m = 2, n = 6]), x = 0 .. a), y = 0 .. b)], [a > 0, b > 0])

-(15/4)*b*a

(6)

``


Download sumsum.mw

 

Reference

September 27 2014 Markiyan Hirnyk 6148
1 0

Two ways

September 27 2014 Markiyan Hirnyk 6148
1 1

This can be done in at least  two ways.

1. This code

works. Here is a part of the output

2. Making use of

,

one obtains 197 solutions, one of these is

See the entire outputs in MVLS.mw

 

 

Six roots

September 26 2014 Markiyan Hirnyk 6148
0 3

There are 6 complex roots satisfying the conditions. These can be found by the DirectSearch in a standard way.


DispersionEq := ((-Omega^2-k^2-8*nu+8)*(-(1/2*(1-nu))*k^2+16-Omega^2-(1/6*(1-nu))*k^2*Zeta^2+(4/3)*Zeta^2)+4*(1+nu)^2*k^2)*((1+(1/12)*Zeta^2*k^4-(8/3)*Zeta^2*k^2+(64/3)*Zeta^2-Omega^2)*(-BesselJ(lambda+1, sqrt(Omega^2*gamma__o^2+k^2))*sqrt(Omega^2*gamma__o^2+k^2)+lambda*BesselJ(lambda, sqrt(Omega^2*gamma__o^2+k^2)))-rho*Omega^2*BesselJ(lambda, sqrt(Omega^2*gamma__o^2+k^2))/Zeta)+(-(-Omega^2-k^2-8*nu+8)*(4+(16/3)*Zeta^2-(1/3*(2-nu))*k^2*Zeta^2)^2-(4*(1+nu))*k^2*(4+(16/3)*Zeta^2-(1/3*(2-nu))*k^2*Zeta^2)*nu+nu^2*k^2*(-(1/2*(1-nu))*k^2+16-Omega^2-(1/6*(1-nu))*k^2*Zeta^2+(4/3)*Zeta^2))*(-BesselJ(lambda+1, sqrt(Omega^2*gamma__o^2+k^2))*sqrt(Omega^2*gamma__o^2+k^2)+lambda*BesselJ(lambda, sqrt(Omega^2*gamma__o^2+k^2))):

A := eval(DispersionEq, [Zeta = 0.25e-1, nu = .3, rho = .128, gamma__o = 3.4, Omega_max = 1.2, lambda = 0, Omega = .6, k = x+I*y]);

((5.24-(x+I*y)^2)*(-.3500729167*(x+I*y)^2+15.64083333)+6.76*(x+I*y)^2)*(-(.653333333+0.5208333333e-4*(x+I*y)^4-0.1666666667e-2*(x+I*y)^2)*BesselJ(1, (4.1616+(x+I*y)^2)^(1/2))*(4.1616+(x+I*y)^2)^(1/2)-1.843200000*BesselJ(0, (4.1616+(x+I*y)^2)^(1/2)))-(-(5.24-(x+I*y)^2)*(4.003333333-0.3541666667e-3*(x+I*y)^2)^2-1.56*(x+I*y)^2*(4.003333333-0.3541666667e-3*(x+I*y)^2)+0.9e-1*(x+I*y)^2*(-.3500729167*(x+I*y)^2+15.64083333))*BesselJ(1, (4.1616+(x+I*y)^2)^(1/2))*(4.1616+(x+I*y)^2)^(1/2)

(1)

DirectSearch:-SolveEquations([evalc(Re(A)), evalc(Im(A))], {x = -5 .. 5, y = -5 .. 5}, AllSolutions, solutions = 10)``

Matrix(6, 4, {(1, 1) = 0.3484019965e-23, (1, 2) = Vector(2, {(1) = HFloat(1.5827339439056232e-12), (2) = HFloat(9.894307595459395e-13)}), (1, 3) = [x = -3.05238710078440, y = .219398452305823], (1, 4) = 109, (2, 1) = 0.4378096180e-23, (2, 2) = Vector(2, {(1) = HFloat(3.8546943414985435e-13), (2) = HFloat(-2.05657713081564e-12)}), (2, 3) = [x = -3.05238710078437, y = -.219398452305870], (2, 4) = 99, (3, 1) = 0.5228535099e-22, (3, 2) = Vector(2, {(1) = HFloat(1.9255708139098715e-12), (2) = HFloat(-6.969758103991808e-12)}), (3, 3) = [x = 3.05238710078419, y = .219398452305840], (3, 4) = 98, (4, 1) = 0.1408861937e-21, (4, 2) = Vector(2, {(1) = HFloat(7.389644451905042e-13), (2) = HFloat(1.184652376196027e-11)}), (4, 3) = [x = 3.05238710078402, y = -.219398452305906], (4, 4) = 52, (5, 1) = 0.4033599754e-16, (5, 2) = Vector(2, {(1) = HFloat(-6.348244596665609e-9), (2) = HFloat(1.8917738110464333e-10)}), (5, 3) = [x = -0.2977592798e-8, y = -.460809956560619], (5, 4) = 65, (6, 1) = 0.1130341906e-15, (6, 2) = Vector(2, {(1) = HFloat(1.0631708846631227e-8), (2) = HFloat(-3.0944434119389626e-11)}), (6, 3) = [x = -0.4869116104e-9, y = .460809995107832], (6, 4) = 80})

(2)

``

``


Download six_solutions.mw

By DirectSearch

September 26 2014 Markiyan Hirnyk 6148
0 13

I think the isolate  command does not work here. How about

DirectSearch:-SolveEquations(%);
?

teliko_with_DS1.mw

Edit. % instead of labels.

By selectremove

September 26 2014 Markiyan Hirnyk 6148
0 4

That hit was asked and answered a lot. Here is an example.

sol := {evalf(solve(z^5-4*z^3+z-1))};

{-1.889948386, -0.8169275189, 1.967994079,
  0.3694409128 - 0.4388902745 I, 0.3694409128 + 0.4388902745 I}

selectremove(has, sol, I);

{0.3694409128 - 0.4388902745 I, 0.3694409128 + 0.4388902745 I},
  {-1.889948386, -0.8169275189, 1.967994079}

See select for info.

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