Kitonum

21525 Reputation

26 Badges

17 years, 74 days

MaplePrimes Activity


These are answers submitted by Kitonum

The following works as expected:

restart;
B := x^4 - 4*x^3/(2 + p) - 6*(p - 1)*x^2/((3 + p)*(2 + p)) - 4*p*(p - 5)*x/((4 + p)*(3 + p)*(2 + p)) - (p - 1)*(p^2 - 15*p - 4)/((5 + p)*(4 + p)*(3 + p)*(2 + p));
for p from -1 to 5000 do
    A[p] := fsolve(B, x, complex);
end do:
ptlist := convert(A,list):
plots:-complexplot(ptlist, x = -1 .. 1.5, y = -0.5 .. 0.5, style = point);

 

It is well known that most of the differential equations cannot be solved symbolically, only numerically. To do this, you must provide an initial condition and use the  numeric  option.

Example:

restart;
Sol:=dsolve({diff(y(x), x) = (6*y(x)^5 - 3*y(x)*x^2 - 20*y(x)^3*x)/(-4*x^3 + 30*y(x)^2*x^2 - 30*y(x)^4 + 7*y(x)^6), y(0)=1}, y(x), numeric);
plots:-odeplot(Sol, [x,y(x)], x=0..1, color=red);

                                            Sol:=proc(x_rkf45) ... end proc
                               

 

Example:

restart;
plots:-polarplot(cos(3*phi*Pi/180), phi=0..360, angularunit=degrees);

                      

 

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]);

                    

 

First 32 33 34 35 36 37 38 Last Page 34 of 290