Kitonum

21500 Reputation

26 Badges

17 years, 61 days

MaplePrimes Activity


These are answers submitted by Kitonum

Note that Maple automatically sorts the elements of your sets in the first list in ascending order. ListTools:-MakeUnique function removes duplicate elements from a list, keeping the order of the elements. Here is Ronan's example:

L1 := [{3, 5}, {4, 5}, {4, 8, 9}, {-7, 2, 3}]:
L2 := ListTools:-MakeUnique(op~(L1));


For your example, use the same commands. 

You should use 2D math Maple Notation (not LaTeX notation) for this. See  Help  ?plot,typesetting

You forgot to put a multiplication sign between 2 parentheses. In addition, it is not clear where  c+cos(x)  should stand, in the numerator or denominator. Maple has the same priority for division and multiplication. Therefore, for example, A/B*C  is understood as  (A*C)/B , and not as  A/(B*C) . Here are the calculations for both cases:

Expr1:=sin(x)/(a*b+a^2*sin(x)^2-d^2*cos(x)^2)*(c+cos(x));
Expr2:=sin(x)/((a*b+a^2*sin(x)^2-d^2*cos(x)^2)*(c+cos(x)));
int(Expr1, x);
int(Expr2, x);
                


Here the indefinite integrals are calculated. To calculate definite integrals, certain restrictions on the parameters are necessary, since a singularity can occur, i.e. zero in the denominator for your range of the integration.

A direct calculation (simbolic and numeric):

restart;
A:=simplify(int(ln(1+x)^3/(x+I), x = 0 .. 1));
B:=simplify(int(ln(1+x)^3/(x-I), x = 0 .. 1));
(A+B)/2;

simplify(evalf(%), zero);
 

The imagenary unit should be coded in Maple as  I  (not  i ).
Here is an example of solving the equation  f(w,B,V,k)=0  for  w  for specified values  B, V, k :

gm:=V->1/sqrt(1-V^2): T:=w-k*V: S:=w*V-k:
f:=unapply(I*B*gm(V)^3*T^3+gm(V)^2*T^2-I*gm(V)^3*T*S^2-1/3*I*B*gm(V)^3*S^3*T-1/3*gm(V)^2*S^2, w,B,V,k);
F:=(B,V,k)->fsolve(f(w,B,V,k), w, complex);
F(1, 0.5, 2);


 

If I understand correctly, you have an equation with several parameters and you want to plot a graph that shows how the roots change depending on the change of parameters. To do this, you need to solve the equation numerically using  fsolve  command. Since the roots are not one, but several, then the number of plots should be the same as the number of roots. In the example below, we explore how the imaginary part of the roots of a quadratic equation changes depending on the change in parameters  p  and  q :

f:=(x,p,q)->x^2+p*x+q:
F:=(p,q)->fsolve(f(x,p,q), complex);
P1:=plot3d(Im('F'(p,q)[1]), p=-10..10, q=-10..10, color=grey, numpoints=10000, axes=normal):
P2:=plot3d(Im('F'(p,q)[2]), p=-10..10, q=-10..10, color=grey, numpoints=10000, axes=normal):
plots:-display(<P1 | P2>);


The graphs clearly show that the region where the imaginary part is 0, i.e. the roots are real, separated by the parabola  p^2-4*q=0  (i.e. the discriminant is 0), and the values of the complex roots are conjugate.


 

restart

sombrea2 := proc (f, g, a, b, paso) local z, m, result; m := a; result := [NULL]; while evalf(m <= b) do z := plot([g(m)+t*(f(m)-g(m)), m, t = 0 .. 1]); result := [op(result), z]; m := m+paso end do; result end proc

f := proc (t) options operator, arrow; -t^2+10 end proc

proc (t) options operator, arrow; -t^2+10 end proc

(1)

g := proc (t) options operator, arrow; t^2-t-3 end proc

proc (t) options operator, arrow; t^2-t-3 end proc

(2)

solve(f(t) = g(t), t)

1/4-(1/4)*105^(1/2), 1/4+(1/4)*105^(1/2)

(3)

with(plots)

plot([f(t), g(t)], t = -10 .. 10, -10 .. 10, color = ["blue", "green"])

 

a := plot({[-t^2+10, t, t = -5 .. 5], [t^2-t-3, t, t = -4 .. 4]})

b := sombrea2(f, g, 1/4-(1/4)*sqrt(105), 1/4+(1/4)*sqrt(105), .1)

display(a, b, scaling = constrained, size = [900, 300])

 

``

 

NULL

NULL


Edit.

Download maple17_new.mw

Probably this model only works adequately on a narrower time range.

For example for  t=0..10 we have:

restart;
with(plots):

s:=10:  m1:=0.02:  m2:=0.5:  m3:=4.4:  r:=0.03:  Tm:=1500:  k:=0.000024:  N:=300:    A:=1:  B:=1-(T(t)+Ti(t))/(Tm): 

dx[1] := -T*V*k*u+B*T*r-T*m1+A: 
dx[2] := T*V*k*u-Ti*m2: 
dx[3] := N*Ti*m2-V*m3: 
H := A*T-(1-u)^2+add(dx[i]*L[i], i = 1 .. 3): 
satu := -(diff(H, T)): 
dua := -(diff(H, Ti)): 
tiga := -(diff(H, V)): 
empat := diff(H, L[1]): 
lima := diff(H, L[2]): 
enam := diff(H, L[3]):

eq1 := diff(L1(t), t) = -A-(-V(t)*k*u(t)+B*r-m1)*L1(t)-u(t)*k*V(t)*L2(t): eq2 := diff(L2(t), t) = -N*m2*L3(t)+m2*L2(t): 
eq3 := diff(L3(t), t) = T(t)*k*u(t)*L1(t)-T(t)*k*u(t)*L2(t)+m3*L3(t): 
eq4 := diff(T(t), t) = -T(t)*V(t)*k*u(t)+B*T(t)*r-T(t)*m1+A: 
eq5 := diff(Ti(t), t) = T(t)*V(t)*k*u(t)-Ti(t)*m2: 
eq6 := diff(V(t), t) = N*Ti(t)*m2-V(t)*m3:

u:=t->-1/(2)*L1(t)*k*V(t)*T(t)+1/(2)*L2(t)*k*V(t)*T(t)+1: 

fcns := {L1(t), L2(t), L3(t), T(t), Ti(t), V(t)}:
 
a := dsolve({eq1, eq2, eq3, eq4, eq5, eq6, L1(10) = 0, L2(10) = 0, L3(10) = 0, T(0) = 800, Ti(0) = 0.4e-1, V(0) = 1.5}, fcns, type = numeric, method = bvp[midrich]):

odeplot(a, [[t, u(t)], [t, V(t)]], 0 .. 10, numpoints = 1000);

                         

But for  t=0..11  we have:

restart;
with(plots):

s:=10:  m1:=0.02:  m2:=0.5:  m3:=4.4:  r:=0.03:  Tm:=1500:  k:=0.000024:  N:=300:    A:=1:  B:=1-(T(t)+Ti(t))/(Tm): 

dx[1] := -T*V*k*u+B*T*r-T*m1+A: 
dx[2] := T*V*k*u-Ti*m2: 
dx[3] := N*Ti*m2-V*m3: 
H := A*T-(1-u)^2+add(dx[i]*L[i], i = 1 .. 3): 
satu := -(diff(H, T)): 
dua := -(diff(H, Ti)): 
tiga := -(diff(H, V)): 
empat := diff(H, L[1]): 
lima := diff(H, L[2]): 
enam := diff(H, L[3]):

eq1 := diff(L1(t), t) = -A-(-V(t)*k*u(t)+B*r-m1)*L1(t)-u(t)*k*V(t)*L2(t): eq2 := diff(L2(t), t) = -N*m2*L3(t)+m2*L2(t): 
eq3 := diff(L3(t), t) = T(t)*k*u(t)*L1(t)-T(t)*k*u(t)*L2(t)+m3*L3(t): 
eq4 := diff(T(t), t) = -T(t)*V(t)*k*u(t)+B*T(t)*r-T(t)*m1+A: 
eq5 := diff(Ti(t), t) = T(t)*V(t)*k*u(t)-Ti(t)*m2: 
eq6 := diff(V(t), t) = N*Ti(t)*m2-V(t)*m3:

u:=t->-1/(2)*L1(t)*k*V(t)*T(t)+1/(2)*L2(t)*k*V(t)*T(t)+1: 

fcns := {L1(t), L2(t), L3(t), T(t), Ti(t), V(t)}:
 
a := dsolve({eq1, eq2, eq3, eq4, eq5, eq6, L1(11) = 0, L2(11) = 0, L3(11) = 0, T(0) = 800, Ti(0) = 0.4e-1, V(0) = 1.5}, fcns, type = numeric, method = bvp[midrich]):

odeplot(a, [[t, u(t)], [t, V(t)]], 0 .. 10, numpoints = 1000);

Output is:
Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution
 

simplify((-1)^n) assuming n::even;
simplify((-1)^n) assuming n::odd;


Edit. If  nx=1 , then the result will always be 1. Therefore, Maple will not be able to show the correct answer without knowing what is  true: nx=1  or  nx=-1

This can be done in many ways. Here is a simple method:

A1:= [a1, a2, a3];
A2:= [b1, b2];
[seq(seq(x/y, x=A1), y=A2)];


In the general case, instead of division, there will be a function of two variables  f(x,y).


 

with(Typesetting)

Settings(typesetdot = true)

``

eq := l = sqrt((d-x(t))^2+h^2)+y(t)

l = ((d-x(t))^2+h^2)^(1/2)+y(t)

(1)

a := solve(eq, y(t))

-((d-x(t))^2+h^2)^(1/2)+l

(2)

a1 := diff(a, t)

(d-x(t))*(diff(x(t), t))/((d-x(t))^2+h^2)^(1/2)

(3)

a2 := diff(a1, t)

(d-x(t))^2*(diff(x(t), t))^2/((d-x(t))^2+h^2)^(3/2)-(diff(x(t), t))^2/((d-x(t))^2+h^2)^(1/2)+(d-x(t))*(diff(diff(x(t), t), t))/((d-x(t))^2+h^2)^(1/2)

(4)

``

a3 := simplify(a2)

((d-x(t))*(x(t)^2-2*d*x(t)+d^2+h^2)*(diff(diff(x(t), t), t))-(diff(x(t), t))^2*h^2)/(x(t)^2-2*d*x(t)+d^2+h^2)^(3/2)

(5)

collect(subsindets(a3, `+`, proc (p) options operator, arrow; Student[Precalculus][CompleteSquare](p, d) end proc), diff)

(d-x(t))*(diff(diff(x(t), t), t))/((d-x(t))^2+h^2)^(1/2)-(diff(x(t), t))^2*h^2/((d-x(t))^2+h^2)^(3/2)

(6)

NULL


 

Download collect_denominator_new.mw

This will be the case if you have an inert sums on the left. But according to your picture it is impossible to understand how the expressions on the left are obtained.

Inert sums are convenient for processing step-by-step calculations as in the code below:


 

1%+2=1+2;

`%+`(1, 2) = 3

(1)

5%+8%+3=5+8+3;

`%+`(`%+`(5, 8), 3) = 16

(2)

256%+321=256+321;

`%+`(256, 321) = 577

(3)

 


 

Download inertsum.mw

The values of all the parameters are needed, for example:

restart;
plot3d(eval(kappa*sech(kappa*(-k^2*t+x)), [kappa=1,k=2]), x = -10 .. 10, t = -10 .. 10);

plot3d(eval((2*(-K^2+k^2))*(K*cosh(k*(-k^2*t+x))+k*cosh(K*(-K^2*t+x)))/((K+k)^2*cosh(k*(-k^2*t+x)-K*(-K^2*t+x))+(-K+k)^2*cosh(k*(-k^2*t+x)+K*(-K^2*t+x))+4*K*k), [k=2,K=3]), x = -10 .. 10, t = -10 .. 10);

plot3d(eval(2*(diff(arctan(lambda*sin(mu*((-3*lambda^2+mu^2)*t+x))*sech(lambda*((-lambda^2+3*mu^2)*t+x))/mu), x)), [lambda=0.5,mu=1]), x = -10 .. 10, t = -10 .. 10);

 

OP wrote  "remove 0=0 from ... if it lie in any position from the set? But  EQI__4  is a list, not a set. If we write  EQI__4  as a set and it does not contain equations in which the number on the left side is less than 0, then due to the automatic sorting of sets, the equation  0=0  will be the first and it is very easy to remove it:

 EQI__4:={omega__0/3=1/30,  -7*omega__0/6-omega__1/6=-13/60, 11*omega__0/6+5*omega__0/6+omega__2/3=47/60, 0=0, omega__1/3+5*omega__2/6=9/20};
EQI__4[2..-1];

 

The code (an example):
 

Eq:=a * q -2 * b * q + 3 * c * q +  d * q - a * w + 5 * b * w + 3.5 * c * w + 5/8 * d * w  = 9;
A:=[op(lhs(Eq))];
B:=map(T->`if`(nops([op(T)])=2,s[cat(i,ListTools:-Search(T,A))],op(1,T)*s[cat(i,ListTools:-Search(T,A))]), A);
`+`(op(B))=rhs(Eq);

The output:

                
          

Edit.

First 100 101 102 103 104 105 106 Last Page 102 of 290