Kitonum

21500 Reputation

26 Badges

17 years, 60 days

MaplePrimes Activity


These are answers submitted by Kitonum

solve({sin(2*x) = 1/2, x <= 2*Pi, -2*Pi <= x}, AllSolutions, explicit);

 

 

I do not know how to use  events  option to your problem, but another way is possible. Yourselves set the parameters  h  and  epsilon . Then decide your equation by  dsolve({de, x(0)=1}, numeric)  (rkf45 method will by default)  and then in a loop by changing the argument with step =  h  interrupt the loop when abs( x(t)- x(t-h) )< epsilon .

Example:

restart;

de := diff(x(t), t) = -x(t):

ds := dsolve({de, x(0) = 1}, numeric):

h := 10^(-3):  epsilon := 10^(-6):  a := 0.:  b := 1.:

for i do

a := a+h: c := rhs(ds(a)[2]):

if abs(c-b) < epsilon then break end if:

b := c:

end do:

op(ds(a));

plots[odeplot](ds, 0 .. a);

 

 

 

 

I have not found a command in Maple that extracts the coefficient of the specified monomial  in a multivariate  polynomial and so I wrote a simple procedure that solves this problem. The procedure called  coefff returns the coefficient of the monomial  t  in the polynomial  P (T - the set of variables of the polynomial).

coefff:=proc(P, T, t)
local L, H, i, k:

L:=[coeffs(P, T, 'h')]:  H:=[h]:  k:=0:

for i from 1 to nops(H) do

if H[i]=t then k:=L[i] fi:

od:

k;

end proc:

 

Example:

P:=x^2-y^2+x-100:

coefff(P,{x,y},x*y),  coefff(P,{x,y},y^2),  coefff(P,{x,y},1);

                                      0, -1, -100

 

 

For specified values of the all parameters solutions can be found without any problems:

a1, b1, a2, b2, a3, b3 := 1.0 $ 6:

dC1 := diff(C1(t), t) = -a1*C1(t)+b1*C2(t):

dC2 := diff(C2(t), t) = a1*C1(t)-(b1+a2)*C2(t)+b2*C3(t):

dC3 := diff(C3(t), t) = a2*C2(t)-(b2+a3)*C3(t)+b3*O1(t):

dO1 := diff(O1(t), t) = a3*C3(t)-b3*O1(t):

syst := dC1, dC2, dC3, dO1:

ics := C1(0) = 1.0, C2(0) = 0., C3(0) = 0., C1(t)+C2(t)+C3(t)+O1(t) = 1.0: funct := [C1(t), C2(t), C3(t), O1(t)]:

sol := dsolve([syst, ics], funct);

plot(eval(funct, sol), t = 0 .. 5, color = [red, blue, green, yellow], legend = [C1(t), C2(t), C3(t), O1(t)]);

 

 

All works if some corrections have been done:

 

C:=proc(n,N)

binomial(N, n);

end proc:

 

theo:=proc(a1::symbol, a2::symbol, N1::integer, N2::integer)

local i;

add(add(d!*C(i,N1)*C(d-i,N2)/a1^i/a2^(d-i), i=0..min(N1,d)), d=0..N1+N2);

end proc:

 

Example:

theo(a,b,3,4);

 

 

The reason for the error is not clear.

For solving of the problem you can use the procedure  TimefromAngle  

from the post  http://www.mapleprimes.com/posts/143494-Maple-For-Clock-And-Degrees-Problem

This procedure allows you to find all the points in time when the hour and minute hands form a specified angle (in your problem 0 degrees). It remains to find the number of seconds in each of these moments and to check that the number of seconds equals the number of minutes.

L:=TimeFromAngle(0, 0..24);
L1:=[seq([op(L[i]), frac(L[i,2])*60], i=1..nops(L))];
select(x->is(x[2]=x[3]), L1);

 

 

Thus, we see that all three indicators coincide only at noon and midnight.

 

a[n]=1/(1-x^(3^n)) - 1/(1-x^(3^(n+1))) ,  a[n]  is n_th term of the series.

The rest is obvious.

1) Go into the site mapleprimes.com.

2) Log in.

3) In the upper right corner there is the word Account. Click on it.

4) ...

Painting individual faces can be set by  plottools[polygon]  command. With regard to edges by  plottools[line]  command.

Example:

with(plottools):

cube := cuboid([0, 0, 0], [1, 1, 1], color = black, style = wireframe):

face1 := polygon([[0, 0, 0], [1, 0, 0], [1, 0, 1], [0, 0, 1]], color = yellow):

face2 := polygon([[0, 0, 0], [0, 0, 1], [0, 1, 1], [0, 1, 0]], color = blue):

face3 := polygon([[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]], color = green):

plots[display](cube, face1, face2, face3, scaling = constrained, axes = boxed, thickness = 3, orientation = [40, 75]);

 

 

Your question needs to be clarified. You can plot only a function of one or two variables. Therefore:

1) The constants  C1, C3, C4, n  should be specified.

2) You wrote that the numbers  b[m], m=1..n   are the roots of the equation  C3*sin (beta/2) =beta*cos (beta/2). But this equation has an infinite number of zeros. I assumed that you are interested in the first  n  positive roots. This equation can be rewritten as  beta=C3*tan(beta/2)  and it becomes clear that if  0<C3<2 then this equation in each interval  0..2*Pi, 2*Pi..4*Pi, 4*Pi..6*Pi  and so on has only one root.

Example:

restart;

W:=(tau, eta)->tau*exp(C4)/C1-exp(C4)*(exp(C3-C3*eta)/C3^2-exp(C3)/C3^2+tau/C1+eta/C3)+exp(C4-C3*eta/2)*sum(16*beta[m]*sin(beta[m]*eta/2)*exp(-(beta[m]*beta[m]+C3^2)*tau/(4*C1))/((beta[m]*beta[m]+C3^2)*( beta[m]*beta[m]-C3^2)^2),m=1..n):

C1, C3, C4, n:=1, 1, 1, 10:

beta:=convert(`minus`({RootFinding[Analytic](sin((1/2)*beta)-beta*cos((1/2)*beta), re = 0 .. 2*n*Pi, im = -1 .. 1)}, {0.+0.*I}), list);

unapply(W(tau, eta), tau, eta);

plot3d(W(tau, eta), tau=0..4, eta=0..4, axes=normal);

 

You can also construct graphs of functions of one variable by fixing the value of another variable, such as

plot(W(1,eta), eta=0..4);

or

plot(W(tau,2), tau=0..infinity);

Use  is  command:

is(1.551691464 < (5/6)*Pi);

             true

 

See  FunctionAdvisor  command.

Example:

L:=[fsolve(x^8-4*x^7+6*x^6-4*x^5+x^4+x^2+2*x+1, x, complex)];

seq(plottools[disk]([Re(L[i]), Im(L[i])], 0.03, color=red), i=1..nops(L)):

plots[display](%);

 

 

2 vectors are collinear if and only if the matrix composed of their coordinates has rank<2. This property is an equivalence relation, and therefore the whole set can be divided into classes according to this property. The procedure  P  produces a partition of S and of each class takes one  first element.

P:=proc(S)

local f, L, M;

L:=convert(S, list);

f:=(x,y)->`if`(LinearAlgebra[Rank](Matrix([x,y]))<2, true, false);

M:=[ListTools[Categorize](f, L)];

print(M);

{seq(M[i,1], i=1..nops(M))};

end proc:

Your example:

S:={[-2, 1, 1, -2, 1, 1], [-2, 1, 1, 2, -1, -1], [0, -1, 1, 0, 1, -1], [0, 1, -1, 0, -1, 1]}:

P(S);

[[[-2, 1, 1, -2, 1, 1]], [[-2, 1, 1, 2, -1, -1]], [[0, -1, 1, 0, 1, -1], [0, 1, -1, 0, -1, 1]]]
            {[-2, 1, 1, -2, 1, 1], [-2, 1, 1, 2, -1, -1], [0, -1, 1, 0, 1, -1]}

If the system contains parameters, the  LinearSolve  command does not give the correct result, even if all the dimensions are specified.

Example:

A:=Matrix([[a,1], [1,b]]):

B:=Vector([1,2]):

LinearAlgebra[LinearSolve](A, B);

For example, if  a=1/2  and  b=2, the result is incorrect.

First 261 262 263 264 265 266 267 Last Page 263 of 290