Kitonum

21550 Reputation

26 Badges

17 years, 125 days

MaplePrimes Activity


These are answers submitted by Kitonum

Another way - not rewrite the system, but simply add extra equation in the original system:

eq1:=J*diff(theta(t),t,t)+b*diff(theta(t),t)=K*i(t):

eq2:=L*diff(i(t),t)+R*i(t)=V(t)-K*diff(theta(t),t):

eq3:=v(t)=diff(theta(t),t):

DCMotor:=[eq1,eq2,eq3];

plot([(x-1)/(x-2), [2, t, t = -5 .. 7], 1], x = -3 .. 7, -4 .. 6, color = [red, blue, blue], thickness = [2, 1, 1], linestyle = [1, 2, 2], discont, labels = [x, y]);

                             

 

 

The same plotting for the second plot. Here the horizontal asymptote is  y=2  not y=1

compoly  is an alternative command for these simplifications:

compoly(numer(f), {x,y});

                                                 x^3-36*z^2, x = 5*x+7*y

That is, we have the identity

numer(f)=subs(%[2], %[1]);

                125*x^3+525*x^2*y+735*x*y^2+343*y^3-36*z^2 = (5*x+7*y)^3 - 36*z^2

 

The same for the denominator.

I think it can be done in different ways. Here's one way as an example:

A:=`01101001`:

`+`(convert(parse(A), base, 10)[]);

                                    4

 For your example:

mylist:=[4,6,2]:

z:=map(convert, mylist, binary):

map2(nprintf, "%08d", z):

map(t->`+`(convert(parse(t), base, 10)[]), %);

                                  [1,2,1]

 

I did not find any mistakes. Just your function decreases very rapidly. It can be clearly seen, if you reduce the range for x-axis:

plot((11), x=0..1, y=0..0.4, labels=["x(m)","PDF(x)"], color=red,thickness=3 );

                                   

 

Addition:

plot((11),x=0..1, y=0..7, labels=["x(m)","PDF(x)"], color=red,thickness=3 );

                                    

 

 

 

 

As OP wrote "the variables are u, v, w, alpha, beta and gamma"  first we define the vector  X(t)  that specifies the order of unknown functions, and then subsequently find matrices  M, C, K  and vector  F :

V:=Vector(6, {(1) = (2*R^2*(diff(w(t), t))*Pi*Omega*h*rho+R^2*(diff(u(t), t, t))*Pi*h*rho-R^2*u(t)*Pi*Omega^2*h*rho = 0), (2) = (R^2*(diff(v(t), t, t))*Pi*h*rho = 0), (3) = (-2*R^2*(diff(u(t), t))*Pi*Omega*h*rho+R^2*(diff(w(t), t, t))*Pi*h*rho-R^2*w(t)*Pi*Omega^2*h*rho = 0), (4) = ((1/4)*R^4*Pi*(diff(alpha(t), t, t))*h*rho+(1/12)*R^2*Pi*(diff(alpha(t), t, t))*h^3*rho+(1/6)*R^2*Pi*(diff(gamma(t), t))*Omega*h^3*rho-(1/12)*R^2*Pi*alpha(t)*Omega^2*h^3*rho = 0), (5) = ((1/2)*R^4*Pi*(diff(beta(t), t, t))*h*rho-(1/2)*R^4*Pi*beta(t)*Omega^2*h*rho = 0), (6) = ((1/4)*R^4*Pi*(diff(gamma(t), t, t))*h*rho+(1/12)*R^2*Pi*(diff(gamma(t), t, t))*h^3*rho-(1/6)*R^2*Pi*(diff(alpha(t), t))*Omega*h^3*rho-(1/12)*R^2*Pi*gamma(t)*Omega^2*h^3*rho = 0)});

 

X(t):=<u(t), v(t), w(t), alpha(t), beta(t), gamma(t)>;

 

M:=Matrix(6, (i,j)->coeff(lhs(V[i]), diff(X(t)[j],t,t)));

C:=Matrix(6, (i,j)->coeff(expand~(lhs~(V) - M.map(diff, X(t),t,t))[i], diff(X(t)[j],t)));

K:=Matrix(6, (i,j)->coeff(expand~(lhs~(V) - M.map(diff, X(t),t,t) - C.map(diff, X(t),t))[i], X(t)[j]));

F:=-expand~(lhs~(V) - M.map(diff, X(t),t,t) - C.map(diff, X(t),t) - K.X(t));

 

Addition: if the order of unknown functions is specified (vector X(t)), we can easily, using a for loop, write a procedure that generalizes the solution to any linear system.

System.mws 

Should be:

ContoursWithLabels(PPP, -1 .. 200, -1 .. 110, [thickness = 3]);

                 

 

 

A version with coloring and with selected contours :

ContoursWithLabels(PPP, -1 .. 200, -1 .. 110, {seq(10^(-5) .. 2.2*10^(-4), 3*10^(-5))}, [color = black, thickness = 2, view = [-1 .. 200, -1 .. 110]], Coloring = [colorstyle = HUE, colorscheme = ["LightYellow", "Orange", "Red"], style = surface]);

                

 

 

 Edited.

 

Your equation has a unique root in any range  -Pi/20+Pi*n/10<=sigma<=Pi/20+Pi*n/10 , n is an integer.

An example for n=1:

fsolve(tan(10*sigma)+tanh(10*sigma) , sigma=Pi/20..3*Pi/20);

                                             0.2365020372

 

The method is based on direct calculation of  1/p , and can be applied to any fraction  1/p   in which  p is prime and p<>2 and p<>5 :

myproc1:=proc(p::prime)

local n;

n:=numtheory[order](10, p);  # Lenght of the period

evalf(1+1/p, n+2):

convert(%, string):

n, %[3..n+2];  # Lenght of the period and the period itself

end proc:

 

Examples of use:

myproc1(7);

myproc1(17);

myproc1(37);

myproc1(97);

 

 

 

 

 

 

In fact, we want to create a vector function of a scalar argument, from which it is easy to extract individual  "coordinate" functions.  

An example  (I use a list instead of Array or Vector):

A:=[sin(x), x^2, x^3-2];

A:=unapply(A, x);

A(m)[1], A(m)[3];

                                   

 

 

a:=[1,2,3,4,5]:

convert(cat(op(a)), string);

                                               "12345"

applyrule(exp(a::anything + lambda::realcons*b::symbol) = exp(a)*exp(lambda*b), F);

If the series is absolutely convergent, then it can be summed by a blocks, for example

evalf(sum(sum(1/(i^4+j^4), i=0..infinity), j=1..infinity));

                                        1.844054925+0.*I

A := plot(x^2, x = -2 .. 2, color = red, thickness = 2, axis[2] = [color = white], labels=[" "," "]):

B := plots[textplot]([[1.9, -0.1, "x values"], [0, 4, "y values"]], align = [below, left], font = [TIMES, ROMAN, 14]):

plots[display](A, B);

                          

 

Edited.

 

 

The procedure  IntersectionOfSegments  solves the problem for any segments on the plane. If the segments do not intersect, then the procedure returns NULL. If segments intersect at the single point, the procedure returns this point (as a list). If the intersection of segments is a segment, then the procedure returns this segment (as a listlist).

IntersectionOfSegments:=proc(S1::listlist,S2::listlist)

local A, B, C, D, f, g, T1, T2, S11, S21, T;

uses geometry;

point(A, S1[1]); point(B, S1[2]); point(C, S2[1]); point(D, S2[2]);

f:=unapply(lhs(Equation(line(AB, [A,B]),[x,y])),x,y);

g:=unapply(lhs(Equation(line(CD, [C,D]),[x,y])),x,y);

if is(f(S2[1][])*f(S2[2][])<=0) and is(g(S1[1][])*g(S1[2][])<=0) then  if is(f(S2[1][])<>0) or is(f(S2[2][])<>0)  then return rhs~(convert(solve({f(x,y), g(x,y)}),list))  elif

is(S1[1,1]<>S1[2,1]) then S11:=sort(S1,(a,b)->is(a[1]<=b[1])); S21:=sort(S2,(a,b)->is(a[1]<=b[1])); if is(S11[2,1]>=S21[1,1]) and is(S11[1,1]<=S21[2,1]) then T1:=sort([S11[1],S21[1]],(a,b)->is(a[1]<=b[1])); T2:=sort([S11[2],S21[2]],(a,b)->is(a[1]<=b[1]));

T:=[T1[2],T2[1]];

return `if`(T1[2]<>T2[1],sort([T1[2],T2[1]],(a,b)->is(a[1]<=b[1])), T1[2]) fi else

S11:=sort(S1,(a,b)->is(a[2]<=b[2])); S21:=sort(S2,(a,b)->is(a[2]<=b[2]));

if is(S11[2,2]>=S21[1,2]) and is(S11[1,2]<=S21[2,2]) then T1:=sort([S11[1],S21[1]],(a,b)->is(a[2]<=b[2])); T2:=sort([S11[2],S21[2]],(a,b)->is(a[2]<=b[2]));

T:=[T1[2],T2[1]];

`if`(is(T1[2]<>T2[1]),sort([T1[2],T2[1]],(a,b)->is(a[2]<=b[2])), T1[2])

fi;  fi; fi; 

end proc:

 

Examples of use:

IntersectionOfSegments([[0,1],[1,0]], [[0,-1],[1,2]]);

IntersectionOfSegments([[0,1],[1,0]], [[1/2,1/2],[2,-1]]);

IntersectionOfSegments([[0,1],[1,0]], [[-2,3],[-1,2]]);

IntersectionOfSegments([[0,0],[0,2]], [[0,1],[0,3]]);

IntersectionOfSegments([[0,0],[0,2]], [[0,5/2],[0,3]]);

IntersectionOfSegments([[0,0],[0,2]], [[0,2],[0,3]]);

                                                

 

 Segments.mws

 

 

 

First 192 193 194 195 196 197 198 Last Page 194 of 290