Kitonum

21500 Reputation

26 Badges

17 years, 60 days

MaplePrimes Activity


These are answers submitted by Kitonum

The reason Maple doesn't fully expand the parentheses is because you forgot to put a multiplication sign between the parentheses in the middle term. If you want Maple to write the resulting two-variable  с  and   polynomial as a one-variable  m  polynomial, you should use the  sort  command:

If you omit this multiplication sign, as you did, Maple interprets this entry in the middle term as calling the sum of two functions  5/2 (constant function)  and 12 c  applied to the argument m-1/2, followed by squaring.

Another example of a function call:

(a+3*b+4)(c+d);

                     

 

You forgot to put the multiplication sign between the brackets in the middle term.

I was about to answer, but Preben Alsholm beat me to it.

In my opinion, Maple's behavior is quite logical. If you do not specify specific initial conditions, then Maple formally returns 2 branches of solutions. But in each specific case, only one branch should be chosen depending on the sign of  v__0. Since you do not specify the meaning of  v__0, then Maple simply does not know which branch should be returned.

restart;	
ode:=v(x)*diff(v(x),x) = g;
dsolve(ode);
ic:=v(x__0) = v__0;
sol1:=dsolve([ode,ic]) assuming v__0>0;
sol2:=dsolve([ode,ic]) assuming v__0<0;

                      

I think it would be more interesting to animate the curve  y = sin(x)^n  shape changing as the exponent  n  changes. Below in the code the exponent increases from  1/6  to  6 :

restart;
with(plots):
L:=[surd(sin(x), 6), surd(sin(x), 5), surd(sin(x), 4), surd(sin(x), 3), surd(sin(x), 2), sin(x), sin(x)^2, sin(x)^3, sin(x)^4, sin(x)^5, sin(x)^6]:
T:=[seq(textplot([3*Pi/8,eval(t,x=3*Pi/8)+0.06,y=t], font=[times,bold,16], align=left), t=L)]:
L1:=[seq(display([plot(t[1],x=0..Pi, color=red, thickness=3, scaling=constrained),t[2]])$10, t=zip((x,y)->[x,y],L,T))]:
display(L1, insequence, size=[800,400]);

               

 

I assumed that  i  (in Maple it should be coded as I )  is the imaginary unit, and  w  is a real parameter.

restart;
Expr:=(2500*I*w)/(1+5*I*w)+(200*I*w)/(1-10*I*w)+5;
evalc(Expr);

# Or

normal(Re(Expr))+normal(Im(Expr))*I assuming real;

                      

restart;
kernelopts(version);

ode:=diff(y(x),x) = (2*sin(2*x)-tan(y(x)))/x/sec(y(x))^2:
ode1:=simplify(ode);

dsolve(ode1);
dsolve(ode1,implicit);

To avoid indexing issues (for matrices, indices start at 1, not 0), we can use arrays instead of matrices. See the visualization below for an example from the   wiki  https://en.wikipedia.org/wiki/Multinomial_distribution  :

restart;
M:=Array(0..6,0..6,{seq(seq((i,j)=6!/(i!*j!*(6-i-j)!)*0.2^i*0.3^j*0.5^(6-i-j),
j=0..6-i),i=0..6)}):
plots:-matrixplot(M, heights = histogram, gap=0.5, tickmarks=[[seq(i=i-1/4,
i=1/4..25/4,1)],[seq(i=i-1/4,i=1/4..25/4,1)],default], labels=[i,j,P(i,j)], 
labelfont=[times,16]);

 

Use the seq command in plots:-textplot .

For some reason the worksheet doesn't open here - so I'm only providing a link to download it.

Download S7MAA_Dveloppement_Limit_new.mw

The final picture:

 

Here is my attempt to animate one of the flexible octahedrons. It is proven that all examples of such octahedrons will be self-intersecting. The intersection lines of two pairs of intersecting faces  BEC  and  AED  ( BCF  and  ADF ) are shown as dashed line. For clarity, faces  BEC  and  AED  are colored. When moving, the lengths of all 12 edges do not change. This octahedron is symmetrical with respect to the horizontal plane in which the anti-parallelogram  ABCD  lies.

restart;
A0:=[-1,0,0]: A1:=[-2,0,0]: C0:=[1,0,0]: C1:=[2,0,0]:
P:=proc(t)
local A, C, D, B, dist, E, F, P1, P2, P3, AED, BCE, S, SE, SF, T, sys;
uses plottools, plots;
A:=(1-t)*~A0+t*~A1; C:=(1-t)*~C0+t*~C1;
S:=[0,C[1],0];
D:=A+[3,3,0]; B:=C+[-3,3,0];
dist:=(X,Y)->sqrt((X[1]-Y[1])^2+(X[2]-Y[2])^2+(X[3]-Y[3])^2);
E:=[0,y,z];
sys:={dist(A,E)=sqrt(10),dist(B,E)=sqrt(10)};
E:=eval([0,y,z],solve(sys, {y,z}, explicit)[2]);
F:=[E[1],E[2],-E[3]];
P1:=curve([A,B,C,D,A], color=black, thickness=3); 
P2:=curve([A,E,D,F,A], color=black, thickness=3);
P3:=curve([B,E,C,F,B], color=black, thickness=3);
AED:=polygon([A,E,D], color="Pink");
BCE:=polygon([B,C,E], color="LightBlue");
T:=textplot3d([[A[],"A",align=[left,below]],[B[],"B",align=left],[C[],"C",align=right],[D[],"D",align=[right,above]],[E[],"E",align=above],[F[],"F",align=below],[S[],"S",align=[left,above]]], font=[times,20], align=left);
SE:=line(S,E, linestyle=dash, thickness=3);
SF:=line(S,F, linestyle=dash, thickness=3);
display(P1,P2,P3,SE,SF,AED,BCE,T);
end proc:

T1:=plots:-animate(P,[t], t=0..1, frames=45, orientation=[-100,80], axes=none, labels=[x,y,z]):
T2:=plots:-animate(P,[t], t=1..0, frames=45, orientation=[-100,80], axes=none, labels=[x,y,z]):
plots:-display([T1,T2], insequence);

                    

flexible_octahedron2.mw

Below is another solution to the problem. See my procedure  Partition    https://mapleprimes.com/posts/200677-Partition-Of-An-Integer-With-Restrictions . For ease of use, I have included the text of this procedure (slightly modified) in my answer.

restart;
Partition:=proc(n::nonnegint, k::{posint,range}, res::{range, nonnegint} := 1, S::set:={$0..n})  # Generates a list of all partitions of an integer n into k parts
local res1, k_Partition, n1, k1, L;
if type(args[-1],set) and S[1]=0 then res1:=0 else res1:=res fi;
k_Partition := proc (n, k::posint, res1, S)
local m, M, a, b, S1, It, L0;
m:=S[1]; M:=S[-1];
if res1::nonnegint then a := max(res1,m); b := min(n-(k-1)*a,M)  else a := max(lhs(res1),m); b := min(rhs(res1),M) fi;
S1:={$a..b} intersect S;
if b < a or b*k < n or a*k > n  then return [ ] fi;
It := proc (L)
local m, j, P, R, i, N;
m := nops(L[1]); j := k-m; N := 0;
for i to nops(L) do
R := n-`+`(op(L[i]));
if R <= b*j and a*j <= R then N := N+1;
P[N] := [seq([op(L[i]), s], s = {$ max(a, R-b*(j-1)) .. min(R, b)} intersect select(t->t>=L[i,-1],S1) )] fi;
od;
[seq(op(P[s]), s = 1 .. N)];
end proc;
if k=1 then [[b]] else (It@@(k-1))(map(t->[t],S1))  fi;
end proc;
if k::posint then return k_Partition(n,k,res1,S) else n1:=0;
for k1 from lhs(k) to rhs(k) do
n1:=n1+1; L[n1]:=k_Partition(n,k1,res1,S)
od;
L:=convert(L,list);
[seq(op(L[i]), i=1..n1)] fi;
end proc:

Partition(8,3,{0,1,4,6,8,9});

[[0, 0, 8], [0, 4, 4], [1, 1, 6]]

(1)

Partition(100,15,{0,1,4,6,8,9});
nops(%);

[[0, 0, 0, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9], [0, 0, 0, 4, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9], [0, 0, 0, 4, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9], [0, 0, 0, 6, 6, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9], [0, 0, 0, 6, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9], [0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9], [0, 0, 1, 1, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9], [0, 0, 1, 4, 6, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9], [0, 0, 1, 4, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9], [0, 0, 1, 6, 6, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9], [0, 0, 1, 6, 6, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9], [0, 0, 1, 6, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9], [0, 0, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9], [0, 0, 4, 4, 4, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9], [0, 0, 4, 4, 6, 6, 8, 9, 9, 9, 9, 9, 9, 9, 9], [0, 0, 4, 4, 6, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9], [0, 0, 4, 4, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9], [0, 0, 4, 6, 6, 6, 6, 9, 9, 9, 9,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9, 9, 9, 9], [4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 9, 9, 9, 9], [4, 4, 4, 4, 4, 6, 6, 6, 8, 9, 9, 9, 9, 9, 9], [4, 4, 4, 4, 4, 6, 6, 8, 8, 8, 8, 9, 9, 9, 9], [4, 4, 4, 4, 4, 6, 8, 8, 8, 8, 8, 8, 8, 9, 9], [4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [4, 4, 4, 4, 6, 6, 6, 6, 6, 9, 9, 9, 9, 9, 9], [4, 4, 4, 4, 6, 6, 6, 6, 8, 8, 8, 9, 9, 9, 9], [4, 4, 4, 4, 6, 6, 6, 8, 8, 8, 8, 8, 8, 9, 9], [4, 4, 4, 4, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8], [4, 4, 4, 6, 6, 6, 6, 6, 6, 8, 8, 9, 9, 9, 9], [4, 4, 4, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 9, 9], [4, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8], [4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 8, 9, 9, 9, 9], [4, 4, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 9, 9], [4, 4, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8], [4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 9, 9, 9, 9], [4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 9, 9], [4, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8], [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 9, 9], [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8]]

 

129

(2)
 

 

Download partition1.mw

Try

convert(2.263681592*10^(-6)*Unit(m^3/s), units, Unit(mL/min));

                                           

I think this equation should be considered as the equation with the unknown  x  and the parameter  n . For this purpose, the solve command has the parametric option. But Maple is weak in working with parameters, this option only works with polynomial equations (in your equation, the parameter is in the exponent). See your example below and an example with a simple equation of degree 1.

restart;
solve(x^n=0, x, parametric);

Error, (in SolveTools:-Parametric) invalid input: non-polynomial equations are not supported

 

solve(a*x=b, x);
solve(a*x=b, x, parametric);

 

 

(1)
 

 

Download parameter.mw

In  Mathematica , to work with parameters, you should use the  Reduce  command, not the  Solve one:

To reasonably find all integer solutions of the first equation, we first rewrite it in the form  tan(3*Pi/x) + 4*sin(2*Pi/x) = sqrt(x) . Note that for  x>=12  ​​the left side decreases and the right side increases and for  x=12  the right side is greater than the left side. This means that all real roots of this equation (not necessarily integer roots) can only exist in the interval  (0, 12) . Similarly, for the second equation we obtain the interval  (0, 37) . Therefore, all integer roots can be easily found by simple enumeration in these intervals (brute force method). When calculating, we exclude those values ​​of the variable x  for which the tangent does not exist.

restart;
Eq1:=tan(3*Pi/x)+4*sin(2*Pi/x)=sqrt(x);
solve(3*Pi/x=Pi/2+Pi*k, x);
seq(%, k=0..3);
for x in {$1..12} minus {2,6} do
if is(Eq1) then print('x'=x) fi;
od:

x:='x':

Eq2:=tan(13*Pi/x)+4*sin(19*Pi/x)=sqrt(x);
solve(13*Pi/x=Pi/2+Pi*k, x);
seq(%, k=0..13);
for x in {$1..36} minus {2,26} do
if is(Eq2) then print('x'=x) fi;
od:

                   

So we get that the first equation has a unique integer root  x=11  and the second equation has a unique integer root  x=7 .

   

You can easily find some solutions in a double loop (brute force method). Of course, finding all solutions remains an open question.

restart;
for x from 1 to 1000 do
for y from 1 to 1000 do
if x!+1=y^2 then print(x,y) fi;
od: od:

                                   4, 5
                                   5, 11
                                   7, 71

1 2 3 4 5 6 7 Last Page 1 of 290