Markiyan Hirnyk

Markiyan Hirnyk

7148 Reputation

25 Badges

11 years, 97 days

MaplePrimes Activity


These are answers submitted by Markiyan Hirnyk

@Kitonum 

f := x ->0.12981e-1+0.80285e-1*cos(.9519256799*x)+0.41370e-1*cos(1.903851360*x)+0.35690e-1*cos(2.855777040*x)+0.147e-3*cos(3.807702720*x):
Student[Calculus1]:-CriticalPoints(f(x), x = -6 .. 6);
  [-5.080827670, -4.391753823, -3.300249925, -2.208746026, 
    -1.519672179, 0., 1.519672179, 2.208746026, 3.300249925,  4.391753823, 5.080827670]

 

restart;
 with(DEtools): with(plots): with(plottools):
 a := -1; b := -3; c := 3; d := 1; omega := 1; v1 := 1; f := -4; epsilon := 0.1e-1;
 sys := diff(u1(t), t) = v1*u1(t)-(omega+u2(t)^2)*u2(t)+u1(t)*(a*(u1(t)^2+u2(t)^2)+b*z(t)^2), diff(u2(t), t) = (omega+u1(t)^2)*u1(t)+v1*u2(t)+u2(t)*(a*(u1(t)^2+u2(t)^2)+b*z(t)^2),
 diff(z(t), t) = z(t)*(-v1+c*(u1(t)^2+u2(t)^2)+z(t)^2)+epsilon*z(t)*(v2+f*z(t)^4); 
solC := dsolve({eval(sys, v2 = 2.0500014987), u1(0) = .6, u2(0) = .6, z(0) = .1}, type = numeric, method = rkf45, maxfun = 10^7, range = 350 .. 750); p1 := odeplot(solC, [t, sqrt(u1(t)^2+u2(t)^2), z(t)], refine = 3, color = burgundy, thickness = 1);
          [Length of output exceeds limit of 1000000]
p1;

The integral under consideration diverges in view of

evalf(series(eval(Function, s = 1), beta, 2));
-.6747165472+(2.856766426*I)*beta+O(beta^2)

(PS. and

evalf(series(eval(Function, beta = 1), s, 2));
Error, division by zero series

}.

There are syntax errors in Result:

tau := 1; betaMin := 0; betaMax := 10; sMin := 0; sMax := 10; 
Result := Im(evalf(Int(Function*cos(beta*tau)/beta, beta = betaMin .. betaMax,
 s = sMin .. sMax, digits = 4)))

 

Specify the parameters and verify whether the results of the formulas are equal.

@tomleslie 

restart; CodeTools:-Usage((rand(0 .. 499999))()$500000,iterations=100);
memory used=1.92MiB, alloc change=163.80MiB, cpu time=9.84ms, real time=10.27ms, gc time=781.25us
          [Length of output exceeds limit of 1000000]

 


 

deq := diff(theta(x), x) = -sin(theta(x)); sol := dsolve({deq, theta(0) = -(1/2)*Pi})

theta(x) = arctan(2*exp(-x+I*Pi)/((exp(-x+I*Pi))^2+1), -((exp(-x+I*Pi))^2-1)/((exp(-x+I*Pi))^2+1))

(1)

simplify(diff(rhs(sol)+2*arctan(exp(-x)), x))``

0

(2)

eval(rhs(sol)+2*arctan(exp(-x)), x = 0)

0

(3)

``

The derivative of the difference is zero on the reals. This implies the difference is a constant function. To dermine its value one may use substition of a concrete number.
 

Download same.mw

Here is an example.


 

restart; with(CurveFitting)NULL
xydata := Matrix([[0, 0], [1, 1], [4, 9], [6, 10], [8, 5], [8, 3]]):

p := plot(c)

 

Now we extract the data from the plot:  

 

a := plottools:-getdata(p)[3]

RTABLE(18446744074180509694, float[8], Matrix, rectangular, Fortran_order, [], 2, 1 .. 200, 1 .. 2)

(1)

plot(a)

 

with(Student[NumericalAnalysis]):

p1 := Student:-NumericalAnalysis:-CubicSpline(convert(a, listlist), independentvar = x):

int(expand(Student:-NumericalAnalysis:-Interpolant(p1)), x = 1 .. 7.5)

44.32074972

(2)

``


 

Download example2.mw


Short comments to the above: the key point consists in making use of Student[NumericalAnalysis]. We construct another interpolant for the data and integrate it. I don't know how to integrate c, i.e.BSplineCurve(xydata, v).



 

Edit. The answer was cardinally rewritten.

 

There are different definitions of the fractional derivative. Up to fracdiff, the fractional derivative according to the Davison-Essex (D-E) definition is implemented in Maple.

  • The Davison-Essex and the Riemann-Liouville definitions are different in the following aspect: in the D-E formula, differentiation is performed first, then integration; in the R-L formula it is the other way around. The D-E definition implemented, thus, maps constants to zero, imitating integer order differentiation, while the R-L definition does not. This property of the D-E definition makes it suitable to work with initial value problems for fractional differential equations.

If you need the fractional derivative in the Riemann-Liouville sense,  you have to implement it on your own. This is not very difficult.

If I correctly understand your question (I don't use MATLAB.), this can be done as follows.


 

ObjF := proc (x, Delta) return sin(x)+cos(x)+Delta end proc:

``

minimize(ObjF(x, Delta), x = 0 .. 2*Pi, location)

-2^(1/2)+Delta, {[{x = (5/4)*Pi}, -2^(1/2)+Delta]}

(1)

Delta := 10; -1; Optimization:-Minimize(ObjF(x, Delta), x = 0 .. 2*Pi)

[HFloat(8.585786437626904), [x = HFloat(3.9269908275141066)]]

(2)

``


 

Download mini.mw

Similar questions were asked and answered a lot. It is enough to somewhat change the if condition in your procedure (see More Gems from the Little Red Book of Maple Magic):

if is( abs(r) < 1/2)

instead of 

 if abs(r) < 1/2 


 

f := proc (x) local r; r := sin(x)+x*cos(x); if is(abs(r) < 1/2) then sin(x) else cos(x) end if end proc;``

proc (x) local r; r := sin(x)+x*cos(x); if is(abs(r) < 1/2) then sin(x) else cos(x) end if end proc

(1)

int(('f')(x), x = -1 .. 1)

2*sin(1)

(2)

``


 

Download proc.mw

Look here to this end.

This can be done as follows. We see a great potential of Maple.


 

restart; J := Int(exp(-(1/2)*v/k)*v^3*exp((1/2)*v/m)*Ei(1, -(1000*I)*v+(1/2)*v/m), v = 0 .. infinity)``

Int(exp(-(1/2)*v/k)*v^3*exp((1/2)*v/m)*Ei(1, -(1000*I)*v+(1/2)*v/m), v = 0 .. infinity)

(1)

L := `assuming`([IntegrationTools:-Change(J, x = v/k, [x])], [k > 0, m > 0])

Int(exp((1/2)*x*(-m+k)/m)*x^3*k^4*Ei(1, -((1/2)*I)*x*k*(2000*m+I)/m), x = 0 .. infinity)

(2)

N := `assuming`([value(L)], [k > 0, m > 0])

16*(48000000000*ln(m*(I+2000*k)/(k*(2000*m+I)))*k^3*m^3-36000*ln(m*(I+2000*k)/(k*(2000*m+I)))*k*m^3+(72000000*I)*ln(m*(I+2000*k)/(k*(2000*m+I)))*k^2*m^3+6000*k^3*m-36000*k^2*m^2+30000*k*m^3+(24000000*I)*k^3*m^2-(24000000*I)*k^2*m^3-(6*I)*ln(m*(I+2000*k)/(k*(2000*m+I)))*m^3-(2*I)*k^3+(9*I)*k^2*m-(18*I)*k*m^2+(11*I)*m^3)*k^4*m/((I+2000*k)^3*(-m+k)^4)

(3)

limit(eval(N, [k = 1]), m = 1)

383999424000024/256000256000096000016000001-(767999808000/256000256000096000016000001)*I

(4)

evalf(%)

0.1499996250e-11-0.2999996250e-14*I

(5)

Digits := 15; -1; int(exp(-(1/2)*v)*v^3*exp((1/2)*v)*Ei(1, -(1000*I)*v+(1/2)*v), v = 0 .. infinity, numeric)

0.1499991612e-11-0.2992397e-14*I

(6)

``


 

Download parametric_integral.mw

 

It is possible, making use of the Physics package. I start from the cites

  • The Inverse command, when applied to an object, represents the object's (noncommutative) multiplicative inverse; that is, Inverse(Z) * Z = Z * Inverse(Z) = 1, where * herein represents the Physics[*] product, whose commutativity depends on the operands (see also type, commutative).
     
  • When the Physics package is loaded, a more general product operator, represented by the same symbol *, is loaded. Unlike the default Maple * operator (herein called the commutative product operator), the * operator loaded with Physics does not assume commutativity of its operands and instead automatically operates like a commutative, anticommutative, or noncommutative product, depending on the corresponding commutation properties of its operands.
  • As with the general Maple simplifier, simplify, when you call the Physics[Simplify] command with no extra arguments, all of the simplifications are attempted. When you call it with extra arguments specifying different simplifications, any of algebrarules, bracketrules, indices, noncommutativeproducts, sum, and int, only the specified simplifications are attempted.
     

In view of the above the following code does the job.

>with(Physics):Setup(mathematicalnotation = true):Setup(noncommutativeprefix={a}):Simplify(a2*Inverse(a2*Inverse(a1)*a2)*a2);
                               a1

Simplify.mw 

Edit. The description of the Simplify command is added.

Confirm this Maple defect. I use Task Manager to cancel Java(TM)... in Processes to this end.

Here is an example.


 

with(PDEtools):``

PDE := r*cos(theta)+r*cos(phi)-1 = 0:

 

 tr := {phi = arctan(y, x), r = sqrt(x^2+y^2+z^2), theta = arccos(z/sqrt(x^2+y^2+z^2))}:

PDE1 := PDEtools:-dchange(tr, PDE);

z+(x^2+y^2+z^2)^(1/2)*x/(x^2+y^2)^(1/2)-1 = 0

(1)
plots:-implicitplot3d(PDE, r = 0 .. 5, phi = 0 .. 2*Pi, theta = 0 .. Pi, coords = spherical, grid = [20, 20, 20], style = surface, shading = z)

 

plots:-implicitplot3d(PDE, r = 0 .. 5, phi = 0 .. 2*Pi, theta = 0 .. Pi, coords = spherical, grid = [20, 20, 20], style = surface, shading = z);

 
plots:-implicitplot3d(PDE1, x = -5 .. 5, y = -5 .. 5, z = -5 .. 5, style = surface, shading = z);

 

plots:-implicitplot3d(PDE1, x = -5 .. 5, y = -5 .. 5, z = -5 .. 5, style = surface, shading = z)

 

``


 

Download dchange.mw

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