Kitonum

19049 Reputation

26 Badges

14 years, 139 days

MaplePrimes Activity


These are answers submitted by Kitonum

Riemann Stieltjes integral can be calculated if it can be reduced to the usual Riemann integral. This can always be done for piecewise continuously differentiable functions. The integral itself must be written in Maple syntax (I use 1Dmath input):

restart;
alpha := x->floor(x):
f:=x->x^2+1:
int(f(x)*diff(alpha(x),x), x=0..3);

 

I don't know the reason for this bug. As a workaround, you can use the  subsindets  command:

subsindets(<sin(u),sin(u)>, sin(anything),t->2*sin(op(1,t)/2)*cos(op(1,t)/2));

 

From wiki: "In geometry, a set of points are said to be concyclic (or cocyclic) if they lie on a common circle"
I arbitrarily took 4 points  [cos(-Pi/6),sin(-Pi/6)], [cos(Pi/4),sin(Pi/4)], [cos(3*Pi/4),sin(3*Pi/4)], [cos(-Pi/2),sin(-Pi/2)]  on the unit circle. A total of 4 solutions were found, in two of which the parabolas  F  and  G  coincide. In the figure - the first solution from the list  L1:

restart;
F:=a1*x^2+b1*x*y+c1*y^2+d1*x+e1*y+1=0:
G:=a2*x^2+b2*x*y+c2*y^2+d2*x+e2*y+1=0:
F1:=b1^2-4*a1*c1=0: G1:=b2^2-4*a2*c2=0:
P:=[[cos(-Pi/6),sin(-Pi/6)],[cos(Pi/4),sin(Pi/4)],[cos(3*Pi/4),sin(3*Pi/4)],[cos(-Pi/2),sin(-Pi/2)]]:
Sys:={seq(eval(F,[x,y]=~p),p=P),F1,seq(eval(G,[x,y]=~p),p=P),G1}:
L:=[solve(Sys, explicit)]:
L1:=evalf(L):
F:=eval(F,L1[1]);
G:=eval(G,L1[1]);
Parabols:=plots:-implicitplot([F,G], x=-3/2..2, y=-5/2..3/2, color=[red,blue], gridrefine=3):
Points:=plots:-pointplot(P, color="Red", symbol=solidcircle, symbolsize=14):
Circle:=plottools:-circle(color=cyan):
plots:-display(Parabols,Points,Circle, scaling=constrained, size=[500,500]);

                 
Addition. In fact, we have the only solution. In solutions  L[1]  and  L[4] , parabolas  F  and  G  differ only in the order of succession.

2_parabolas.mw     

restart;
expr:=exp(3*I*x - x):
evalc(expr);  
simplify(evalc(expr));
# Or 
factor(evalc(expr)); 
restart;
M:=<<seq(j+1,j=1..5)>|<seq(2*j, j=1..5)>>:
plot(M, style=pointline, color=red, symbol=solidcircle, symbolsize=12, view=[0..6,0..10], scaling=constrained);

 

It doesn't need loops. This is done directly from two vectors using the  seq  command:

restart;
<<x,seq(j+1,j=1..5)>|<y,seq(2*j, j=1..5)>>;

                                         


It can be made prettier using the  DocumentTools:-Tabulate  command:

M:=<<x,seq(j+1,j=1..5)>|<y,seq(2*j, j=1..5)>>:
DocumentTools:-Tabulate(M, width=10):

                                            

One intermediate step:

C1 := sqrt(r+1)*sqrt(1/(r-1)); C2 := -sqrt(r^2-1)/(r-1);
C11:=combine(C1) assuming r+1>0;
is(C11=C2) assuming r<1, r>0;

                         

 

 

Your matrix  F  is only defined for values on the main diagonal and below. You can define its values above the main one as you like. For example, the code below defines a skew-symmetric matrix:

restart;
for i to 6 do
for j to i do
F[i, j] :=  g(i+1)/g(j);
 end do:
end do:
F:=Matrix(6,6,(i,j)->`if`(i>=j,F[i,j],-F[j,i]));

 

If I understand your question correctly, here are two simple ways:

restart;
interface(rtablesize=infinity):
Matrix([seq([i,ithprime(i)], i=1..99)]);
# Or
Matrix(99,2, (i,j)->`if`(j=1,i, ithprime(i)));

 

For the calculation, we used the evenness of the function  f(k)=(-1)^k/k * sin(k*x) , the value at zero  k=0  calculated  through the limit, and also used the assumption (assuming real)  for the parameter  x :

restart;
Sum((-1)^k/k * sin(k*x), k=-infinity..infinity)=limit((-1)^k/k * sin(k*x),k=0)+2*evalc(sum((-1)^k/k * sin(k*x), k=1..infinity)) assuming real;

       

 

The result obtained can be substantially simplified to a piecewise constant function (R11 in the code below). Unfortunately, Maple does not make such a complete simplification (does in the range  x=-Pi..Pi  only)  and the piecewise-function  R11  is found manually:

R:=x-2*arctan(sin(x)/(cos(x)+1));
R1:=normal(applyop(convert,[2,2,1],R, tan));
simplify(R1) assuming x>-Pi,x<Pi;
R11:=piecewise(x=(2*n-1)*Pi,(2*n-1)*Pi,x>-Pi+2*Pi*n and x<Pi+2*Pi*n,2*Pi*n); # assuming n::integer
plots:-display(plot(R, x=-5*Pi+0.01..5*Pi, color=red, thickness=2, discont),plot([seq([(2*n-1)*Pi,(2*n-1)*Pi],n=-2..2)],style=point, symbol=solidcircle, color=red), scaling=constrained);

                    

             

Matrix([["A", "B"], ["C", "D"]]);
# Or
<"A","B"; "C","D">;

 

If you want some graph to remain unchanged, then simply give the new graph a new name using the  inplace=false  option:

with(GraphTheory):
H := CompleteGraph(4);
G:=DeleteEdge(H, {1, 2},inplace=false);
DrawGraph(H);
DrawGraph(G);

 

restart

with(student)

with(PDEtools)

inf := 10^(-2)

mu := exp(-lambda*theta(y, t))

``

equ1 := R*(diff(w(y, t), t)) = mu*(diff(w(y, t), `$`(y, 2)))+(diff(mu, y))*(diff(w(y, t), y))-M*w(y, t)+L+Gr*theta(y, t)

R*(diff(w(y, t), t)) = exp(-lambda*theta(y, t))*(diff(diff(w(y, t), y), y))-lambda*(diff(theta(y, t), y))*exp(-lambda*theta(y, t))*(diff(w(y, t), y))-M*w(y, t)+L+Gr*theta(y, t)

(1)

equ2 := R*Pr*(diff(theta(y, t), t)) = diff(theta(y, t), `$`(y, 2))+Br*mu*(diff(w(y, t), y))^2+Ra*((theta(y, t)+1)^4-1)

R*Pr*(diff(theta(y, t), t)) = diff(diff(theta(y, t), y), y)+Br*exp(-lambda*theta(y, t))*(diff(w(y, t), y))^2+Ra*((theta(y, t)+1)^4-1)

(2)

parameters := [Gr = 1, Pr = 7.1, R = .5, lambda = .5, Bi = 1, M = .5, Ra = .1, L = 1, Br = .1]

IBC := [w(y, 0) = 0, theta(y, 0) = 0, (D[1](w))(0, t) = 0, (D[1](theta))(0, t) = 0, w(inf, t) = 0, (D[1](theta))(inf, t)+Bi*theta(inf, t) = 0]

[w(y, 0) = 0, theta(y, 0) = 0, (D[1](w))(0, t) = 0, (D[1](theta))(0, t) = 0, w(1/100, t) = 0, (D[1](theta))(1/100, t)+Bi*theta(1/100, t) = 0]

(3)

pds := pdsolve({subs(parameters, equ1), subs(parameters, equ2)}, {subs(parameters, IBC)[]}, numeric, time = t, range = 0 .. 10^(-2))

_m1761663908192

(4)

 

Download PDE_solution_new.mw

This is not so easy to do due to the way Maple works with numbers in the  float  format. First we convert  0.03  to an exact fraction, put it out of brackets, and at the end we do the reverse conversion:

restart;
f:=0.03-0.03*cos(5.885*t);
f1:=applyop(convert, {1,[2,1]}, f, fraction);
3/100*``(f1/(3/100));
subs(3/100=0.03,%);  # The desired result

                            

 

Probably this problem is related to your version of Maple. Everything works as expected in Maple 2018:


 

restart

with(plots)

 
   

 

 
 
 

f := proc (x) options operator, arrow; sin(100/(x+13)) end proc

proc (x) options operator, arrow; sin(100/(x+13)) end proc

(2.1.1)

g := proc (x) options operator, arrow; 10/(10*x+3) end proc

proc (x) options operator, arrow; 10/(10*x+3) end proc

(2.1.2)

gr_f := plot(f(x), x = 0 .. 30, y = -2 .. 2, legend = "f", font = [times, normal, 6], legendstyle = [font = [times, normal, 6]], labelfont = [times, normal, 6])

gr_g := plot(g(x), x = 0 .. 30, y = -2 .. 2, legend = "g", color = blue, font = [times, normal, 6], legendstyle = [font = [times, normal, 6]], labelfont = [times, normal, 6])

display(gr_f, gr_g)

 

 

 

A := fsolve(f(x) = g(x), x = 1.1)

1.049742001

(2.2.1)

B := fsolve(f(x) = g(x), x = 1.7)

1.676209051

(2.2.2)

C := fsolve(f(x) = g(x), x = 20)

19.35519742

(2.2.3)

 

 

assume(E > C)

solve(int(f(x)-g(x), x = C .. E) = 3, E, UseAssumptions)

28.05987548

(2.3.1)

fsolve(int(f(x)-g(x), x = C .. E) = 3, E)

12.00027508

(2.3.2)

fsolve(int(f(x)-g(x), x = C .. E) = 3, E = 30)

28.05987548

(2.3.3)

 

La valeur de E cherchée est donc d'environ 28,06 unités.


 

Download Problem_of_integral_new.mw

First 6 7 8 9 10 11 12 Last Page 8 of 272