Markiyan Hirnyk

Markiyan Hirnyk
10 years, 83 days


These are answers submitted by Markiyan Hirnyk

It is not a good idea

Yesterday at 1:10 PM Markiyan Hirnyk 6842

You may realize that on your own, making use of the ContextMenu package of Maple. The set of Maple functions is big. Would it be really good for you?

By casesplit

February 07 2016 Markiyan Hirnyk 6842

This can be done as follows,


eq1 := diff(VL(t), t) = iL(t)/C:
``

with(DEtools):

casesplit({eq1, eq2})

`casesplit/ans`([iL(t) = (diff(VL(t), t))*C, diff(diff(VL(t), t), t) = (-R*(diff(VL(t), t))*C+V-VL(t))/(L*C)], [])

(1)

``

See help to casesplit for more info.

Download casesplit.mw

By filled option

February 02 2016 Markiyan Hirnyk 6842

This can be done as follows.


plots:-implicitplot(evalc(eval(abs(z+1+I) >= abs(z-1-I), z = x+I*y)), x = -2 .. 2, y = -2 .. 2, filled, coloring = [navy, white]);

 

``


Download filled.mw

By stats

January 31 2016 Markiyan Hirnyk 6842

This can be done with the deprecated stats package as follows. It is unclear for me what is kvartils. Because of thi reason, both kurtosis and quartiles are calculated.
>restart; with(stats):
>data := [Weight(.5 .. .7, 26), Weight(.7 .. .9, 43), Weight(.9 .. 1.1, 102), Weight(1.1 .. 1.3, 145), Weight(1.3 .. 1.5, 171), Weight(1.5 .. 1.7, 196), Weight(1.7 .. 1.9, 119), Weight(1.9 .. 2.1, 42), Weight(2.1 .. 2.3, 9)]:
>describe[kurtosis](data);

                          2.596138659
>quartiles := [seq(describe[quartile[i]], i = 1 .. 3)]: quartiles(data);
            [1.158275862, 1.429239766, 1.655867347]
>transform[cumulativefrequency](data);

          [26, 69, 171, 316, 487, 683, 802, 844, 853]
>[seq((op([j, 1, 1], data)+op([j, 1, 2], data))*(1/2), j = 1 .. nops(data))];

[0.6000000000, 0.8000000000, 1.000000000, 1.200000000,

  1.400000000, 1.600000000, 1.800000000, 2.000000000, 2.200000000

  ]
>plots:-pointplot([[seq((op([j, 1, 1], data)+op([j, 1, 2], data))*(1/2), j = 1 .. nops(data))], transform[cumulativefrequency](data)], style = line, color = navy, thickness = 3, gridlines = false);

 



Download stats.mw

Maple does it

January 28 2016 Markiyan Hirnyk 6842

It is useful to rewrite an indefinite integral as a definite one:

 

restart

eq := ln(t)^n*t^n/factorial(n):

`assuming`([int(eq, t = 1 .. x)], [n::int, x > 1])

-ln(x)^n*(GAMMA(n)*(-(n+1)*ln(x))^(-n)*n-(-(n+1)*ln(x))^(-n)*GAMMA(n, -(n+1)*ln(x))*n-x^(n+1))/(factorial(n)*(n+1))

(1)

`assuming`([int(eq, t = 1 .. x)], [n::int, x > 0, x < 1])

-(-1)^n*(-ln(x))^n*(-(-(n+1)*ln(x))^(-n)*GAMMA(n, -(n+1)*ln(x))*n+GAMMA(n+1)*(-(n+1)*ln(x))^(-n)-x^(n+1))/(factorial(n)*(n+1))

(2)

``

 

Download integral2.mw

 

 

 

 

Yes, it is

January 20 2016 Markiyan Hirnyk 6842

The system in a, b, c, and  s (a free variable) can be recovered in such a way.

A := allvalues([a = s/RootOf(_Z^2-s^2+s), b = -RootOf(_Z^2-s^2+s)/s, c = RootOf(_Z^2-s^2+s)]);

The two possible systems of three equations in four unknowns are obtained. Let us verify it.

eliminate(solve(A[1]), {b, c});

solve(a^2*s-a^2-s, a);


Under some assumptions (PS. For example, s>1)

equals

.

I leave details on your own.

By CubaDivonne

January 20 2016 Markiyan Hirnyk 6842

This can be done as follows.

>restart; Digits := 15; infolevel[`evalf/int`] := 4; evalf(Int(exp(-add(x[i], i = 1 .. 10)^3),
 [seq(x[i] = 0 .. 1, i = 1 .. 10)], method = _CubaDivonne,
 methodoptions = [peaks = [`$`(0, 10)]], epsilon = 0.1e-2));

Control_multi: integrating on [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] .. [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] the integrand
  exp(-(x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7] + x[8]

     + x[9] + x[10])^3)
cuba: transformed original integrand
  exp(-(x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7] + x[8]

     + x[9] + x[10])^3)
cuba: with lower bounds [0., 0., 0., 0., 0., 0., 0., 0., 0., 0.] and upper bounds [1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], to the following integrand to be integrated over the unit n-cube:
  exp(-(x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7] + x[8]

     + x[9] + x[10])^3)
cuba: integration completed successfully
cuba: # of integrand evaluations: 3332269
cuba: estimated (absolute) error: 2.95777e-005
cuba: chi-square probability that the error is not reliable: 1.07117e-017
cuba: number of regions that the domain was divided into: 651
                  HFloat(2.53041133315004e-6)

This is done quite mechanically. The code works for other integrands too. The result is not so exact as the one by vv. See http://www.maplesoft.com/support/help/AddOns/view.aspx?path=evalf/Int/cuba&term=cuba for info.

 

By CubaCuhre

January 19 2016 Markiyan Hirnyk 6842

If you look in ?evalf,Int, then you will find

>evalf(Int(exp((sum(x[i], i = 1 .. 6))^2), [seq(x[i] = -1 .. 1, i = 1 .. 6)], method = _CubaCuhre, epsilon = 0.1e-6));

                 

This works in Maple 2015.

This can be done by the Laplace transform as follows (See textbooks concerning conditions and assumptions).

 

restart

with(PDEtools):

laplace(pde, t, s)

-(D[2](u))(x, 0)+(D[1, 1, 2](u))(x, 0)+(-u(x, 0)+(D[1, 1](u))(x, 0))*s+b*laplace((diff(diff(u(x, t), x), x))^3, t, s)-a*(diff(diff(laplace(u(x, t), t, s), x), x))+s^2*laplace(u(x, t), t, s)-s^2*(diff(diff(laplace(u(x, t), t, s), x), x)) = 0

(1)

``

 We see an ODE in laplace(u(x, t), t, s) treated as a function of x. The above ODE also includes the parameter s .

Download change.mw

PS. See https://www.youtube.com/watch?v=kvEqw6tUtgM 

as the first seeing and listening.

PPS. The Laplace transfor is efficient in the linear case. Your PDE in Thomas'  interpretation is not linear.

 

The suggested workarounds do work. I don't understand what causes the difference between the outputs of

plots:-contourplot(exp(2*x/(x^2+y^2)), x = -2 .. 2, y = -2 .. 2,
grid = [100, 100], coloring = [blue, red], contours = [.1, .3, .5, 1, 2]);

and

plots:-contourplot(
     ln(exp(2*x/(x^2+y^2))), x= -2..2, y= -2..2, grid= [100$2],
     coloring= [blue, red], contours= ln~([.1, .3, .5, 1, 2]), filledregions
); .

It seems that the contourplot command can be improved and should be improved.

Harmonic number

January 05 2016 Markiyan Hirnyk 6842

Maple answers

>sum(1/k, k = 1 .. n);

                       Psi(n + 1) + gamma

See ?Psi, ?gamma, and Wiki for info.

Megahit

December 28 2015 Markiyan Hirnyk 6842

That was asked and answered a lot. In particular, the following code works.

>g := proc (y, t) options operator, arrow; sin(y(t)) end proc;

(y, t) -> sin(y(t))
>Physics:-diff(g(y, t), y(t));

                           cos(y(t))

By shadebetween

December 27 2015 Markiyan Hirnyk 6842

This is mechanized since Maple 2015 by

plots:-shadebetween(sin(x), cos(x), x = 0 .. 4*Pi, scaling = constrained);

One more way

December 23 2015 Markiyan Hirnyk 6842

@H-R 

restart; with(Student[VectorCalculus]): TangentVector(<cos(t), sin(t)>, range = 0 .. 2*Pi, output = plot, scaling = constrained, vectoroptions = [length = .20]);

Better fit

December 18 2015 Markiyan Hirnyk 6842

can be obtained by the DirectSearch.


restart

X := Vector([73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91]):

Y := Vector([35, 35, 36, 41, 47, 42, 43, 37, 34, 28, 28, 30, 27, 33, 35, 38, 42, 42, 40]):

with(plots):NULL

with(DirectSearch):

a1 := pointplot(zip(`[]`, X, Y)):

f := DataFit(a*sin(b*x+c)+d, X, Y, x, fitmethod = lms, strategy = globalsearch, method = quadratic)

[HFloat(3.5164774213446393), [a = HFloat(7.524152778633754), b = HFloat(6.768478719445874), c = HFloat(-350.0884442255459), d = HFloat(35.38852427207049)], 9139]

(1)

a2 := plot(eval(a*sin(b*x+c)+d, f[2]), x = 72 .. 92):

plots:-display(a1, a2, gridlines = false)

 

NULL

Let us count the sum of the squared residuals  for your model function and mine:
f1 := unapply(8*sin(.5*x-5.5)+36, x)
 

proc (x) options operator, arrow; 8*sin(.5*x-5.5)+36 end proc

(2)

convert(map(proc (c) options operator, arrow; c^2 end proc, map(proc (x) options operator, arrow; f1(x) end proc, X)-Y), `+`)

HFloat(108.1008367092042)

(3)

NULL

convert(map(proc (c) options operator, arrow; c^2 end proc, map(proc (x) options operator, arrow; eval(a*sin(b*x+c)+d, f[2]) end proc, X)-Y), `+`)

HFloat(66.81307100554812)

(4)

``

Hope you will make the conclusion on your own.


Download better_fit.mw

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