Kitonum

21525 Reputation

26 Badges

17 years, 75 days

MaplePrimes Activity


These are answers submitted by Kitonum

Look at this post  https://www.mapleprimes.com/posts/200677-Partition-Of-An-Integer-With-Restrictions , which presents the  Partition  procedure. The procedure solves a variety of problems associated with partition of an integer, in particular partition with different restrictions.

After the loading  screen appears, open the task manager, then the details, then 2 times destroy the process whose name begins with  jogamp_...

restart; 
f := (x,y)->x+y ; 
f2 :=  (x,y)->x^2+y^3 ; 
f3 := f+f2; 
f3(x,y); 
f3(5,10);

 

Replace the last line with

plots:-odeplot(sol, [[t, B(t)], [t, L(t)], [t, S(t)]], t = 0 .. .3, color = [red, blue, green], legend = [B(t), L(t), S(t)], labels = [t, ``]);

 

factor(algsubs(8*k + 2=t^2, f)) assuming t>0;
subs(t=sqrt(8*k + 2), %);

 

A simple procedure  P  allows you to create the matrix  M  for any number  N :

restart;
P:=(N::posint)->Matrix(N+1, {seq((i,i+1)=i, i=1..N)}):


Example of use:

P(9);

You can use a set of any symbols (even spaces) as a name if you surround it with slanting quotes. Many years ago, I wrote a procedure to automatically check the work of my students, in which  chi^2 (Pearson's test) was used as a name. See examples below:

chi^2:=5;
`chi^2`:=5;
`My name`:=Yury;

      


See help on  ?Names  for details.

Here is 2 options to draw - in a for loop and as a table:

restart;
with(GraphTheory):
Graphs_data3:=[NonIsomorphicGraphs(6,restrictto =[connected], output
= graphs, outputform =graph)]:
Diameter2_select:=select[flatten](t->Diameter(t)=2,Graphs_data3):
nops(%);
for G in Diameter2_select do
DrawGraph(G);
od;
plots:-display(Matrix(12,5, [seq(DrawGraph(Diameter2_select[i]), i=1..59),plot(NULL, axes=none)]));
                               

 

Maybe OP wants to get the result written as a polynomial in the variable  x . This is easy to do, both symbolically (that is, exactly) and approximately:

collect(expand(convert(series(sin(x), x=1), polynom)), x);
evalf(%);
plot([sin(x), %], x=-1..3, color=[red,blue]);

The plot shows that in the range  [-1, 3]  the graphs  sin(x)  and the polynomial  almost the same.

A:=Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]):
B := Matrix(ListTools:-Reverse(convert(A, listlist)));

 

I understood the question that several separately created animations should simultaneously (in parallel) be reproduced on the same plot. To obtain the desired ranges in both axes, use the  view  option. Example below:

A:=plots:-animate(plot,[x^2, x=-2..a, color=red], a=-2..2, frames=60):
B:=plots:-animate(plot,[sin(2*x), x=0..a, color=blue], a=0..2*Pi, frames=60):
plots:-display(A, B, view=[-2..2*Pi, -1..4]);

   

 


If you are interested in various ways of combining several animations (parallel and sequential), then look at this post  https://www.mapleprimes.com/posts/207840-Combinations-Of-Multiple-Animations

Maple does not support the solution of symbolic matrix equations, even in the simplest case  A.X=B  when A is a invertible matrix. Similar equations can be solved in  LinearAlgebra  package only for specific  matrices  A  and  B .

restart;
N:=5:
A:=Matrix(N):
for i from 1 to N do
for j from 1 to N do
A[i,j]:=1/(i*j);
od: od:
A;

Of course, the same can be done in short:

A:=Matrix(5, (i,j)->1/(i*j));

 

restart;
simplify([a^4 + b^4 + c^4, a^5 + b^5 + c^5], {a+b+c=1, a^2+b^2+c^2=2, a^3+b^3+c^3=3});
solve({a+b+c=1, a^2+b^2+c^2=2, a^3+b^3+c^3=3});
evalf(%);

 

Here are the solutions:

# Question 1:
f:=x->x^3-2*x;
a:=0:  b:=2:
solve(f(b)-f(a)=D(f)(c)*(b-a), c);
evalf(%);

# Question 2:
g:=x->surd((x-3)^2, 3);
a:=-3:  b:=4:
solve(g(b)-g(a)=D(g)(c)*(b-a), c);
evalf(%);

In the first example of the two solutions obtained, we should select only the positive root.

Note that in the second example the point  c  does not belong to the interval   [-3,4] . The reason is that the function  g  is not differentiable at the point  x=3 . See the plots:

plot(f, 0..2);
plot(g, -3..4);

 

First 88 89 90 91 92 93 94 Last Page 90 of 290