Markiyan Hirnyk

Markiyan Hirnyk

7153 Reputation

25 Badges

11 years, 124 days

MaplePrimes Activity


These are answers submitted by Markiyan Hirnyk

I think you mind

sum(k*sin(k*x)/(k^2+p^2+k), k = 1 .. infinity);

or 

sum(k*sin(k*x)/(k^2+p^2+k), p = 1 .. infinity);

If so, then

sum(k*sin(k*x)/(k^2+p^2+k), k = 1 .. infinity, parametric) assuming real;

(1/4)*(LerchPhi(exp(I*x), 1, 1/2-(1/2)*(-4*p^2+1)^(1/2))*(-4*p^2+1)^(1/2)+LerchPhi(exp(I*x), 1, 1/2+(1/2)*(-4*p^2+1)^(1/2))*(-4*p^2+1)^(1/2)-LerchPhi(exp(-I*x), 1, 1/2-(1/2)*(-4*p^2+1)^(1/2))*(-4*p^2+1)^(1/2)-LerchPhi(exp(-I*x), 1, 1/2+(1/2)*(-4*p^2+1)^(1/2))*(-4*p^2+1)^(1/2)-LerchPhi(exp(I*x), 1, 1/2-(1/2)*(-4*p^2+1)^(1/2))+LerchPhi(exp(I*x), 1, 1/2+(1/2)*(-4*p^2+1)^(1/2))+LerchPhi(exp(-I*x), 1, 1/2-(1/2)*(-4*p^2+1)^(1/2))-LerchPhi(exp(-I*x), 1, 1/2+(1/2)*(-4*p^2+1)^(1/2)))/(4*p^2-1)^(1/2)

and

sum(k*sin(k*x)/(k^2+p^2+k), p = 1 .. infinity, parametric) assuming real;

-(1/2)*k*sin(k*x)*Psi(1-sqrt(-k^2-k))/sqrt(-k^2-k)+(1/2)*k*sin(k*x)*Psi(1+sqrt(-k^2-k))/sqrt(-k^2-k)

do the job.

First, we solve

RealDomain:-solve(-0.6e-2*x^2+10.4*x-1230-624*sin(0.2e-2*x) = 0, [x]);
             [[x = 1611.337335], [x = 148.5712385]]

Second, the expression -0.6e-2*x^2+10.4*x-1230-624*sin(0.2e-2*x) defines a continuous function on the reals. It's well known that a continuous function on the reals  is of constant sign between its two consecutive roots. In view of it we determine

eval(-0.6e-2*x^2+10.4*x-1230-624*sin(0.2e-2*x), x = 0.);        
                         -1230.    
eval(-0.6e-2*x^2+10.4*x-1230-624*sin(0.2e-2*x), x = 200.);                   
                         367.0029544
eval(-0.6e-2*x^2+10.4*x-1230-624*sin(0.2e-2*x), x = 1700.);
                          -730.5423524

 

Therefore, the (approximate, of course) answer is x >= 148.5712385, x <= 1611.337335.

 

 

This can be done as follows.

Student[Calculus1]:-Roots((10*cos((6*(1/10))*t)-10*cos((3/10)*t+(1/4)*Pi))^2+(10*sin((6*(1/10))*t)-10*sin((3/10)*t+(1/4)*Pi))^2 = 0, t = 0 .. 20*Pi);

[(5/6)*Pi, (15/2)*Pi, (85/6)*Pi]

The plot

plot((10*cos(6/10*t) - 10*cos(3/10*t+1/4*Pi))^(2)+( 10*sin(6/10*t)-10*sin(3/10*t+1/4*Pi))^(2),t=0..20*Pi);

confirms it.

Your statement

  • Only weights of type "numeric" can be used in a weighted graph (package GraphTheory) 

is not based by you. It is possible  to give the infinite weight to an edge/arc. Moreover, one can work with such weights. Here is an example.

restart;
with(GraphTheory):
G := Graph({[3, 1], {1, 2}, {2, 3}});
           G := `Graph 1: a directed unweighted graph with 3 vertices and 5 arc(s)`
M := Matrix([[0, infinity, 3], [infinity, 0, 1], [3.18, 1, 0]]):
H1 := MakeWeighted(G, M);
          H1 := `Graph 2: a directed weighted graph with 3 vertices and 5 arc(s)`
Diameter(H1);
          infinity
DrawGraph(H1);



Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/example.mw .

Download example.mw

@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

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