Kitonum

21525 Reputation

26 Badges

17 years, 75 days

MaplePrimes Activity


These are answers submitted by Kitonum


 

restart;
eq1:= (-k*I + 2*I + m)*sqrt(3) - 3*I*m - 3*k;
eq2:=eq1/2;
eq_given:= a*(k + I*m) + b;

match(eq2 = eq_given, {k,m}, 's');
s;

(-I*k+2*I+m)*3^(1/2)-(3*I)*m-3*k

 

(1/2)*(-I*k+2*I+m)*3^(1/2)-((3/2)*I)*m-(3/2)*k

 

a*(k+I*m)+b

 

true

 

{a = -((1/2)*I)*(3^(1/2)-3*I), a = -((1/2)*I)*3^(1/2)-3/2, b = I*3^(1/2)}

(1)

 


 

Download Q20200817_new.mw


 

restart;
Expr:=W__1 + W__2 = -sin(-beta + alpha)*((H^2 - h^2)*gamma + h^2*psi)/(2*sin(beta)*sin(alpha));
applyop(p->H^2*p,2,applyop(p->collect(expand(p/H^2),gamma),[2,3],Expr));

W__1+W__2 = -(1/2)*sin(-beta+alpha)*((H^2-h^2)*gamma+h^2*psi)/(sin(beta)*sin(alpha))

 

W__1+W__2 = -(1/2)*H^2*sin(-beta+alpha)*((1-h^2/H^2)*gamma+h^2*psi/H^2)/(sin(beta)*sin(alpha))

(1)

 


 

Download 1.mw

Example:

restart;
N:=8: # The number of the points
plot([seq([n/(N-1),ln(1+sin(Pi*n/(N-1)))], n=0..N-1)], legend = numerical, style = point, symbol = box, color = blue, symbolsize = 15);

 

1. Don't use square brackets to group terms, only parentheses.
2. In this example, use  simplify  with  siderels :


 

restart;

with(Student[LinearAlgebra]):

eq4:= v__a(t) = (v__an(t)-v__ap(t))/2 - L__arm/2*diff((i__ap(t)-i__an(t)), t) - R__arm/2*(i__ap(t)-i__an(t));

v__a(t) = (1/2)*v__an(t)-(1/2)*v__ap(t)-(1/2)*L__arm*(diff(i__ap(t), t)-(diff(i__an(t), t)))-(1/2)*R__arm*(i__ap(t)-i__an(t))

(1)

eq4_2:= simplify(eq4, {i__ap(t)-i__an(t) = i__a(t)});

v__a(t) = (1/2)*v__an(t)-(1/2)*v__ap(t)-(1/2)*L__arm*(diff(i__a(t), t))-(1/2)*R__arm*i__a(t)

(2)

 


 

Download Maximum_Modulation_Index_for_MMC_with_CCC_new.mw
 

In fact, your simplification requires no assumptions. You can get an even better simplification through  tan(x/2) :


 

restart;
u1:=-ln(csc(x)-cot(x));
simplify(u1);
convert(u1, tan);
eval(%, {tan(x)=2*tan(x/2)/(1-tan(x/2)^2)});
applyop(normal,[2,1],%);

-ln(csc(x)-cot(x))

 

-ln((1-cos(x))/sin(x))

 

-ln((1/2)*(1+tan((1/2)*x)^2)/tan((1/2)*x)-1/tan(x))

 

-ln((1/2)*(1+tan((1/2)*x)^2)/tan((1/2)*x)-(1/2)*(1-tan((1/2)*x)^2)/tan((1/2)*x))

 

-ln(tan((1/2)*x))

(1)

 


 

Download simpl.mw

Your system only has a zero solution:


 

restart; with(LinearAlgebra)

M := Matrix(Matrix(7, 7, {(1, 1) = -mu, (1, 2) = a[1]*beta[x]*k[1]*PI[h]/mu, (1, 3) = omega[o]*beta[x]*a[1]*PI[h]/mu, (1, 4) = sigma, (1, 5) = -beta[2]*PI[h]/mu, (1, 6) = 0, (1, 7) = a[1]*beta[x]*k[2]*PI[h]/mu, (2, 1) = 0, (2, 2) = -(mu+r[o]+alpha[o])*a[1]*beta[x]*k[1]*PI[h]/mu, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = a[1]*beta[x]*k[2]*PI[h]/mu, (3, 1) = 0, (3, 2) = 0, (3, 3) = -(mu+r[1]+alpha[1]+k[o])*a[1]*beta[x]*k[1]*PI[h]/mu, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = omega[o]*beta[x]*a[1]*k[2]*PI[h]/mu, (4, 1) = 0, (4, 2) = r[o], (4, 3) = r[1], (4, 4) = -mu-sigma, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (5, 1) = 0, (5, 2) = alpha[o], (5, 3) = alpha[1], (5, 4) = 0, (5, 5) = -e[o], (5, 6) = 0, (5, 7) = 0, (6, 1) = 0, (6, 2) = -a[2]*beta[y]*k[1]*PI[m]/mu[b], (6, 3) = -a[2]*beta[y]*k[2]*PI[m]/mu[b], (6, 4) = 0, (6, 5) = -a[2]*beta[y]*PI[m]/mu[b], (6, 6) = -mu[b], (6, 7) = 0, (7, 1) = 0, (7, 2) = a[2]*beta[y]*k[2]*PI[m]/mu[b], (7, 3) = a[2]*beta[y]*k[2]*PI[m]/mu[b], (7, 4) = m[7, 4], (7, 5) = a[2]*beta[y]*PI[m]/mu[b], (7, 6) = 0, (7, 7) = -mu[b]})); V := Vector([`$`(0, 7)])

Matrix(7, 7, {(1, 1) = -mu, (1, 2) = a[1]*beta[x]*k[1]*PI[h]/mu, (1, 3) = omega[o]*beta[x]*a[1]*PI[h]/mu, (1, 4) = sigma, (1, 5) = -beta[2]*PI[h]/mu, (1, 6) = 0, (1, 7) = a[1]*beta[x]*k[2]*PI[h]/mu, (2, 1) = 0, (2, 2) = -(mu+r[o]+alpha[o])*a[1]*beta[x]*k[1]*PI[h]/mu, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = a[1]*beta[x]*k[2]*PI[h]/mu, (3, 1) = 0, (3, 2) = 0, (3, 3) = -(mu+r[1]+alpha[1]+k[o])*a[1]*beta[x]*k[1]*PI[h]/mu, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = omega[o]*beta[x]*a[1]*k[2]*PI[h]/mu, (4, 1) = 0, (4, 2) = r[o], (4, 3) = r[1], (4, 4) = -mu-sigma, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (5, 1) = 0, (5, 2) = alpha[o], (5, 3) = alpha[1], (5, 4) = 0, (5, 5) = -e[o], (5, 6) = 0, (5, 7) = 0, (6, 1) = 0, (6, 2) = -a[2]*beta[y]*k[1]*PI[m]/mu[b], (6, 3) = -a[2]*beta[y]*k[2]*PI[m]/mu[b], (6, 4) = 0, (6, 5) = -a[2]*beta[y]*PI[m]/mu[b], (6, 6) = -mu[b], (6, 7) = 0, (7, 1) = 0, (7, 2) = a[2]*beta[y]*k[2]*PI[m]/mu[b], (7, 3) = a[2]*beta[y]*k[2]*PI[m]/mu[b], (7, 4) = m[7, 4], (7, 5) = a[2]*beta[y]*PI[m]/mu[b], (7, 6) = 0, (7, 7) = -mu[b]})

 

Vector[column](%id = 18446745476990704686)

(1)

LinearSolve(M, V)

Vector[column](%id = 18446745477001216958)

(2)

 


 

Download trc_new.mw

 

Here is the procedure to write explicitly this double sum:

restart;
S:=n->sum(sum(a[i,j]*x^i*y^j, j=0..n-i), i=0..n);

# Example
S(3);

proc (n) options operator, arrow; sum(sum(a[i, j]*x^i*y^j, j = 0 .. n-i), i = 0 .. n) end proc

 

x^3*a[3, 0]+x^2*y*a[2, 1]+x*y^2*a[1, 2]+y^3*a[0, 3]+x^2*a[2, 0]+x*y*a[1, 1]+y^2*a[0, 2]+x*a[1, 0]+y*a[0, 1]+a[0, 0]

(1)

 


 

Download double_sum.mw

OP wrote "Never understood the proc() without parameters"

In fact, everything is clear here. Parameterless procedures are often used when the number of actual parameters (called arguments) is not known in advance. In this case they are referred with  args (argument sequence)  and  nargs (number of arguments) :

Your generalized example (finds the Euclidean norm for any dimension):

 norm:=proc()
sqrt(sum(args[i]^2,i=1..nargs)) end:

norm(3,4,5);

                                      

 

In the following example, we find the arithmetic mean of a sequence of numbers for any number of these numbers:

restart;
M:=proc()
`+`(args)/nargs;
end proc:

# Example:

M(2,3,5,6);

                                        4

Example:

convert(1.0*a+b, rational);

                           a + b

From the help:
"Important: The evalb command does not simplify expressions. It may return false for a relation that is true. In such a case, apply a simplification to the relation before using evalb."

Your example:

restart;
f := x + 1 = (x^2 - 1)/(x - 1):
evalb(simplify(f));

                                     true


See help for details.
 

This is not a surface but a curve as the intersection of two surfaces (the cylinder  (y-1)^2+z^2=1  and the plane  x=1 ):


 

restart;
plots:-intersectplot((y-1)^2+z^2=1, x=1, x=0..2, y=0..2, z=0..1, thickness=2, axes=normal, scaling=constrained);

 

 


 

Download plot.mw

I don't see any point in solving such a simple problem with Maple. We get the answer immediately only by looking at the drawing without any calculations. SK=KB, KO=1/3*KB so  cos(SKB) = 1/3 .

              

 

The code for the pic.

restart;
local O;
with(plottools): with(plots):
A:=[0,0,0]: B:=[1/2,sqrt(3)/2,0]: C:=[1,0,0]: S:=[1/2,sqrt(3)/6,sqrt(2/3)]: K:=[1/2,0,0]: O:=[1/2,sqrt(3)/6,0]:
AB:=line(A,B): BC:=line(C,B): AC:=line(A,C): AS:=line(A,S): BS:=line(B,S): CS:=line(C,S): KS:=line(K,S): SO:=line(S,O): KB:=line(K,B):
T:=textplot3d([[A[],"A"], [B[],"B"], [C[],"C"], [S[],"S"], [K[],"K"], [O[],"O"]], font=[times,bold,18], align={left,above}):  
display(AB,BC,AC,AS,BS,CS,KS,SO,KB,T, color=black, axes=none, orientation=[-50,75], scaling=constrained);

 

restart;
M:=2*p*q*r*s*t/(u*v*w); 
simplify(M, {p*q/(u*v)=K});

 

We can of course use  map , but the code will be a little more cumbersome:

A:=[1,2,3]:
B:=[7,8,9]:
map(f@op, [seq([A[i],B[i]],i=1..nops(A))]);

                        [f(1, 7), f(2, 8), f(3, 9)]

restart;
sum((-1)^n/n*x^n, n=1..infinity) assuming x>-1, x<=1;

                                         -ln(1+x)


Edit. You can use the  parametric  option as well:

restart;
sum((-1)^n/n*x^n, n=1..infinity, parametric);

                 

 

First 53 54 55 56 57 58 59 Last Page 55 of 290