Kitonum

20084 Reputation

26 Badges

17 years, 22 days

MaplePrimes Activity


These are answers submitted by Kitonum

The problem is easily reduced to solving the equation in integers:

restart;
isolve(5*x-7=16*y);

                 {x = 11+16*_Z1, y = 3+5*_Z1}


So  x = 11+16*_Z1  is the set of all the solutions,  _Z1  is an integer.

First you must specify  ma1  as a list:

ma1 := [0., .1941703021, .3203871063, .4089371834, .4712881303, .5145114133, .5435036431, .5617715009, .5718586242, .5756277760, .5744585726]:

subs(ma1[1]=1,ma1);
# Or
subsop(1=1,ma1);

[1, 0.1941703021, 0.3203871063, 0.4089371834, 0.4712881303, 0.5145114133, 0.5435036431, 0.5617715009, 0.5718586242, 0.5756277760, 0.5744585726]
[1, 0.1941703021, 0.3203871063, 0.4089371834, 0.4712881303, 0.5145114133, 0.5435036431, 0.5617715009, 0.5718586242, 0.5756277760, 0.5744585726]

 

Use the  fieldplot  command from the  plots  package. The grid option controls the number of arrows:

fieldplot(<a, b>, x = -100 .. 100, y = -100 .. 100, arrows = SLIM, grid = [10, 10]);

               

 

 

You can use the combinat:-partition command and then the  select  command to remove duplicate parts:

combinat:-partition(15,8):
select(t->nops(t)=nops({t[]}), %);

[[1, 2, 3, 4, 5], [2, 3, 4, 6], [1, 3, 5, 6], [4, 5, 6], [1, 3, 4, 7], [1, 2, 5, 7], [3, 5, 7], [2, 6, 7], [1, 2, 4, 8], [3, 4, 8], [2, 5, 8], [1, 6, 8], [7, 8]]

restart; 
f:=x->x^2-x+3:
g:=x->3*x-5:
solve(f(x)>=0 or f(x)<0);  # Finding the domain of the function f(x)
h:=f-g:
# Finding the range of the h(x)
m:=minimize(h(x), x=-infinity..infinity);
M:=maximize(h(x), x=-infinity..infinity);

                                            

So we have:  (-infinity, infinity)  is the domain of  f(x)[4, infinity)  is the range of  h(x) . Here we use the continuity of the function  h(x)  that takes all intermediate values between  and  M .

 

Use the  seq  command for this.
An example:

restart;
n:=7:
assign(seq(a[i]=i, i=1..n));
P:=piecewise(x<a[1],x, seq(op([x<a[k],(-1)^k*sqrt(0.5^2-(x-(k-0.5))^2)+1]),k=2..n), 1);
plot(P, x=-1..n+2, view=[-1..n+2,-1..2], scaling=constrained, size=[800,400]);

            

      

 

 

You can extract data from a plot using the  plottools:-getdata  command. The data is retrieved as a two-column matrix. See a simple example below:

restart;
plot([y^2,y, y=-1..1]);
plottools:-getdata(%);
%[3][1..10];

 

The integral must be introduced in the inert form:

restart;
A:=Int(exp(-4*tau)*sin(2*tau)/2, tau=0..t);
Student:-Calculus1:-ShowSolution(A);

Download Int.mw

It can be written much shorter using arrow-notation. We see that Maple finds this sum symbolically in a closed form. For large numbers N , this is much more efficient:

restart;
sum2N:=N->sum((N+k)^2, k=0..N);

# Examples
sum2N(N);
sum2N(10);

                

 

Alternative :

[seq(rhs~(t)[],t=[a])];

                  [-23, -12, -34, 87, 18, 98, 27, 93, 45, 68]

restart;
Sys := Y(t)=diff(y(t),t,t), diff(y(t), t, t)+y(t)*abs(y(t)) = 0; 
ic1 := y(0) = 1, D(y)(0) = 0; 
dsol1 := dsolve({Sys, ic1}, numeric, range = 0 .. 10);
plots:-odeplot(dsol1,[t,y(t)]); 
plots:-odeplot(dsol1, [t,diff(y(t),t)]);
plots:-odeplot(dsol1, [t,Y(t)]);

 

The  Picture  procedure is not suitable for your task. Use the built-in maple-procedure  plots:-inequal  for this:

restart;
plots:-inequal({x^2+y^2<=9,x^2+y^2>=4}, x = -4 .. 4, y = -4 .. 4, optionsfeasible = [color = yellow], optionsclosed = [color = brown, thickness = 3]);

                    

 

In fact, you are trying to find all 3 roots of the third degree of 1 in the complex domain. The shortest way to do this is to simply solve the equation  z^3=1 :

restart;
solve(z^3=1);

                             

 

That is the  LinearAlgebra:-MatrixExponential  command. See help for details on this command.

If you just type  a^3*sqrt(a);  Maple calculates it as  a^(7/2) . The desired display requires a special procedure. Procedure  P  displays an expression of the type  symbol^fraction  in the desired form.

P:=proc(p::symbol^fraction)
local e, a, n, k, m;
uses InertForm;
e:=op(2,p); a:=op(1,p);
n:=floor(e); k:=e-n; m:=surd(a^numer(k),denom(k));
`if`(n=0,m,`%*`(a^n,m));
Display(%,inert=false);
end proc:

Examples of use:

P(a^(7/2));
P(b^(8/3));
P(a^(2/5));

                                                

 

 

First 22 23 24 25 26 27 28 Last Page 24 of 280