Kitonum

21475 Reputation

26 Badges

17 years, 49 days

MaplePrimes Activity


These are answers submitted by Kitonum


 

restart;
subexp := M__a*sin(omega*t + alpha)*I__a*sin(omega*t + phi);
subexp2:=factor(combine(subexp));
d:=M__a*I__a:
subexp22:=d*``(subexp2/d)

 

M__a*sin(omega*t+alpha)*I__a*sin(omega*t+phi)

 

(1/2)*M__a*I__a*(cos(alpha-phi)-cos(2*omega*t+alpha+phi))

 

M__a*I__a*``((1/2)*cos(alpha-phi)-(1/2)*cos(2*omega*t+alpha+phi))

(1)

 


 

Download identity.mw

restart;
with(Statistics):
X:=Vector([0,0.001,0.002,0.003,0.004,0.005,0.006,0.007,0.008,0.009,0.01,0.012]):
Y:=Vector([1.103,1.057,1.016,0.978,0.94,0.91,0.88,0.85,0.826,0.8,0.778,0.735]):
Fn:=Fit((-a*t+b)/(-d+e*t+f*t^3),X,Y,t);
add((Y-~[seq(eval(Fn,t=x),x=X)])^~2); # residual sum of squares
plots:-display(plot(X,Y,style=point,color=red,symbolsize=12), plot(Fn,t=X[1]..X[-1],color=blue), labels=["X","Y"]);

Download RS.mw


 

restart;
A:=x<7: B:=-10<x and x<25: C:=x>15:

solve(A and B);

RealRange(Open(-10), 7)

(1)

solve(B or C);

RealRange(Open(-10), infinity)

(2)

solve(A and B and C); # Return NULL that is empty set

solve(A or B or C); # Whole real number axis

x

(3)

 


 

Download solve.mw


 

restart;
S:=proc(n)
local P;
uses combinat;
P:=permute([0$n,1$n]):
select(p->andmap(k->add(p[1..k])<=k/2, [$ 1..2*n]), P);
end proc:

S(3);
nops(%);
seq(nops(S(n)), n=1..7);

 

[[0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 1, 1], [0, 0, 1, 1, 0, 1], [0, 1, 0, 0, 1, 1], [0, 1, 0, 1, 0, 1]]

 

5

 

1, 2, 5, 14, 42, 132, 429

(1)

 


Edit.

Download seq_edit.mw

To avoid repeated calls to Typesetting:-Settings , you can enter your equations through the procedure  below:

restart;
P:=proc(ode)
local t;
t:=indets(ode, name)[];
Typesetting:-Settings(usedot=false,prime=t,typesetprime=true):
ode;
end proc:

ode1:=P(diff(y(t),t$2)+diff(y(t),t)+y(t)= 0);
ode2:=P(diff(y(x),x$2)+diff(y(x),x)+y(x)= 0);

diff(diff(y(t), t), t)+diff(y(t), t)+y(t) = 0

 

diff(diff(y(x), x), x)+diff(y(x), x)+y(x) = 0

(1)

 


 

Download prime.mw

Use  assign  for this instead of  :=  :

restart;
for a from 1 to 2 do
assign(convert(cat("k",a),symbol)=a);
od;
k1, k2;

                                             1, 2

Here is another way of assignment through the seq command (multiple assignment), where  :=  doesn't work, but  assign  does:

restart;
seq(k||i, i=1..2) := seq(a, a=1..2);  # an error
assign(seq(k||i=i, i=1..2));  # OK
k1, k2;  # check

   Error, invalid left hand side in assignment
                              1, 2


 

restart;
assume(omega>0);assume(zeta>0 and zeta<1);
tf:=omega^2/(s^2+2*zeta*omega*s+omega^2);
y:=tf*1/s;
yt:=inttrans:-invlaplace(y,s,t);
dyt:=diff(yt,t);

solve(dyt=0,t, allsolutions);
about(_Z1);

omega^2/(2*omega*s*zeta+omega^2+s^2)

 

omega^2/((2*omega*s*zeta+omega^2+s^2)*s)

 

1-exp(-omega*zeta*t)*cos((-zeta^2+1)^(1/2)*omega*t)-zeta*exp(-omega*zeta*t)*sin((-zeta^2+1)^(1/2)*omega*t)/(-zeta^2+1)^(1/2)

 

exp(-omega*zeta*t)*(-zeta^2+1)^(1/2)*omega*sin((-zeta^2+1)^(1/2)*omega*t)+zeta^2*omega*exp(-omega*zeta*t)*sin((-zeta^2+1)^(1/2)*omega*t)/(-zeta^2+1)^(1/2)

 

Pi*_Z1/((-zeta^2+1)^(1/2)*omega)

 

Originally _Z1, renamed _Z1~:
  is assumed to be: integer

 

 


 

Download dyt.mw

Let's define new functions  Sin, Cos, Tan, Cot  for which arguments are assumed in degrees:

Sin:=x->sin(x*Pi/180):
Cos:=x->cos(x*Pi/180):
Tan:=x->tan(x*Pi/180):
Cot:=x->cot(x*Pi/180):

# Examples
Sin(30);
Tan(45);
Cos(30);

 

Probably this integral cannot be calculated symbolically (even for the specific values of the parameters). So calculate numerically.

Example:


 

restart;
t:=1: A:=2: omega:=3: tau:=4: phi:=5:
int( ((-A*omega*sin(omega*x+phi)*exp(-x/tau) - A*cos(omega*x+phi)*exp(-x/tau)/tau)^2 + 1)^(1/2), x=0..t );
int( ((-A*omega*sin(omega*x+phi)*exp(-x/tau) - A*cos(omega*x+phi)*exp(-x/tau)/tau)^2 + 1)^(1/2), x=0..t, numeric );

int(((-6*sin(3*x+5)*exp(-(1/4)*x)-(1/2)*cos(3*x+5)*exp(-(1/4)*x))^2+1)^(1/2), x = 0 .. 1)

 

3.482744646

(1)

 


 

Download int.mw

This can be done in many ways. Here are two options (long and short):


 

restart;
data:=[0,12,0,7,5,3,7,10,0,0,9,3,2,5,0,6]:
N:=0:
for d in data do
if d>=7 then N:=N+1 fi;
od:
N;

5

(1)

nops(select(`>=`, data, 7));

5

(2)

 


 

Download 1.mw


 

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

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