Markiyan Hirnyk

Markiyan Hirnyk

7163 Reputation

25 Badges

11 years, 162 days

MaplePrimes Activity


These are answers submitted by Markiyan Hirnyk

eq1 := x[1]-x[2] = 0: 
eq2 := -x[1]+2*x[2]-x[3] = 0:
eq3 := -x[2]+2*x[3]-x[4] = 0:
eq4 := -x[3]+x[4]-t = 0:
solve({eq1, eq2, eq3, eq4}, [x[1], x[2], x[3], x[4]]);
  []

Up to ?solve

  • If the solve command does not find any solutions, then if the second argument is a name or set of names, then the empty sequence (NULL) is returned; if the second argument is a list, then the empty list is returned. This means that there are no solutions, or the solve command cannot find the solutions. In the second case, a warning is issued, and the global variable _SolutionsMayBeLost is set to true.
     

this indicates no solution. 

is as follows.

 restart; Digits := 15: 
 f := .9/abs(t-.4)^(1/3)+.1/abs(t-.6)^(1/2):
 G1 := -.9445379894:
 A := dsolve({a(0) = 0, (D(a))(t) = f*exp(t)}, numeric);
 B := dsolve({b(0) = 0, (D(b))(t) = f*exp(-t)}, numeric);
 rhs(B(.2)[2]);
.270547407517139
U1 := proc (x) options operator, arrow; -(1/2)*exp(-x)*(rhs((eval(A(t), t = x))[2])+G1)-(1/2)*exp(x)*(rhs((eval(B(t), t = x))[2])+G1) end proc:
U := proc (x) options operator, arrow; -(1/2)*exp(x)*(rhs((eval(B(t), t = x))[2])+G1)+(1/2)*exp(-x)*(rhs((eval(A(t), t = x))[2])+G1) end proc:
F := proc (s) options operator, arrow; U(s)^2+U1(s)^2-(2*.9/abs(s-.4)^(1/3)+2*.1/abs(s-.6)^(1/2))*U(s) end proc:
F(.2);
                  HFloat(-0.08307649472006268)
evalf(Int(F, 0 .. 1, method = _d01ajc), 8);
                          -0.37533515
evalf(Int(F, 0 .. 1, method = _d01ajc), 7);
                           -0.3753352

In the above the Joe Riel's idea is used.

another_way.mw

Similar questions were asked and answered many times. Procedures are plotted specifically. Try 

plot(myPi_1, 0 .. 500, numpoints = 500, thickness = 2, color = black);

The integral 

int(U1(x)^2+U(x)^2-2*f(x)*U(x), x=0..1)

diverges because of the singularity at x=3/5. Here are my arguments.

First, let us switch to exact calculations by

f := convert(.9/abs(x-.4)^(1/3)+.1/abs(x-.6)^(1/2), rational): 
G1 := convert(-.9445379894, rational):

Second, the latest Maple versions (Maple 2015 and Maple 2016) handle  integrals of  moduli:

a := int(f*exp(t), t = 0 .. x);
(1/10)*(exp(x)*abs(x-2/5)^(1/3)+9*exp(x)*sqrt(abs(x-3/5))-abs(x-2/5)^(1/3)-9*sqrt(abs(x-3/5)))/(abs(x-2/5)^(1/3)*sqrt(abs(x-3/5)))
b := int(f*exp(-t), t = 0 .. x);
(1/10)*(exp(x)*abs(x-2/5)^(1/3)+9*exp(x)*sqrt(abs(x-3/5))-abs(x-2/5)^(1/3)-9*sqrt(abs(x-3/5)))*exp(-x)/(abs(x-2/5)^(1/3)*sqrt(abs(x-3/5)))

Now

U1 := -(1/2)*exp(-x)*(a+G1)-(1/2)*exp(x)*(b+G1):
U := -(1/2)*exp(x)*(b+G1)+(1/2)*exp(-x)*(a+G1):
limit((U^2-2*U*f+U1^2)*abs(x-3/5), x = 3/5);
(1/200)*exp(6/5)-1/100+(1/200)*exp(-6/5)
evalf(%);
                         0.008106555680

Therefore, the integrand behaves as constant/|x-3/5| around x=3/5. This implies the divergence.

divergence.mw 

question.docx

 

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

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