Kitonum

21530 Reputation

26 Badges

17 years, 84 days

MaplePrimes Activity


These are answers submitted by Kitonum

restart;

f(x) = 2.25*f(x-1)-0.5*f(x-2);

convert(%, rational);

f := unapply(rsolve({%, f(1) = 1/3, f(2) = 1/12}, f(x)), x);

plots[display](<plot(f, 1 .. 40, color = red) | plots[logplot](f, 1 .. 40, color = red)>);

 

 

Left - the usual plot, right - logplot.

 

Here is the simplest code, generating the first  N  rows of Pascal's Triangle:

PascalTriangle:=proc(N)

local n;

for n from 0 to N-1 do print(seq(binomial(n,k), k=0..n)) od;

end: 

 

Example:

PascalTriangle(10);

 

 

Line:=plot(x^2-2*x+2, x=-0.5..2.5, -0.5..3.5, thickness=2):

Point:=plottools[disk]([1,1],0.04, color=blue):

plots[display](Line, Point, scaling=constrained);

 

 

For such a simple task we don't need in Maple (and it will not help if, for example, instead of 1000 we take 10 ^ 10). Instead the range 1 .. 1000 consider the range 0 .. 999, adding zeros in front if the number of digits is less than 3:  000, 001, 002, etc. Total used 3 * 1000 = 3000 digits and because of the equality of all digits  the answer will be 3000/10 = 300

The procedure  MultiAdd  solves your problem:

MultiAdd:=proc(f::procedure, L::list(range))

local M, T, m, S;

uses combinat;

M:=map(i->[$ i], L);

T:=cartprod(M);  S:=0;

while not T[finished] do

m:=T[nextvalue]();  S:=S+f(op(m))

end do;

S;

end proc:

Example:

MultiAdd((i,j,k)->1/(i*j*k), [1..5, 2..8, 3..7]);

                              3360747/784000

 

 

Replace  Diff  by  diff :

restart: with(DEtools):

DEexp1:=2*y(x)*(y(x)-4):

DE:=diff(y(x),x)=DEexp1: 

DEplot(DE, y(x), x=-1..1, y=-2..7.4);

You can not substract a vector from a number. You can use the formula:

theta:=Vector(m, i->90) - lambda;  # m is the numbers of rows

 

Example:

m:=4:  theta:=Vector(m, i->90) - lambda:

lambda:=<10, 90, 0, -60>:

theta;

                   <80, 0, 90, 150>

 

For longitude all is similar only use  `if`  command.

 

 

RealRange(0, 2*Pi)  minus  `union`(solve({x >= 0, cos(x) = 0, x <= 2*Pi}, AllSolutions, explicit));

 

 

 is already implemented in Maple (version 16). See  ?worksheet,plotinterface,zoom

 

Addition: in older versions zooming can be done by scaling along axes.

Example of zooming of the plot  y=x*sin(7*x)  in 10 times:

plots[animate](plot, [(x/k)*sin(7*x/k)*k, x = -Pi .. Pi,thickness=2, tickmarks=[0,0]], k=1..10, frames=200);

 

p1:=a*n1+b/n2+c*(n1+n2)^2:

subs(n1+n2=1, p1);

                       a*n1+b/n2+c

restart;

solve(subs(z=t, [x + 3*y + 5*z = 0, 7*x + 9*y + 11*z = 0, 13*x + 15*y + 17*z = 0]), {x,y});

                                       {x = t,  y = -2*t}

Your system has a lot of parameters (15 ones). I do not think that Maple can solve it in general terms.

Here is a numerical solution for the specified parameter values. Maple gives one solution. The problem of finding all solutions remains open.

Example of numerical solution:

restart;

eq1 := A-B*a-V*a*q/z-W*(b+d)*a/z = 0;

eq2 := W*(b+d)*a/z-V*b*q/z-(F*G+B+D1)*b = 0;  # D is replaced by D1, as D is a protected name

eq3 := V*a*q/z-W*c*(b+d)/z-(B+C+E)*c = 0;

eq4 := V*b*q/z+W*(b+d)*c/z-(B+C+D1+F)*d = 0;

eq5 := G*F*b-V*q*e/z-(B+H)*e = 0;

eq6 := H*e-V*q*f/z-(B+S)*f = 0;

eq7 := S*f-V*q*g/z-B*g = 0;

eq8 := V*q*g/z+S*s-(B+C+E)*h = 0;

eq9 := F*d+V*q*e/z-(B+C+H+T)*t = 0;

eq10 := H*t+V*q*f/z-(U+B+C+2*S)*s = 0;

eq11 := T*t+W*(b+d)*x/z-(B+H+Y)*u = 0;

eq12 := U*s-(B+S)*v+H*u-Y*H*v/(H+S) = 0;

eq13 := g-c-d-t-s-h = 0;

eq14 := z-a-b-c-d-e-f-g-h-s-t-u-v = 0;

A:=1: B:=3: C:=2: D1:=4: E:=5: F:=6: G:=7: H:=3: S:=5: T:=10: V:=1: W:=1: U:=3: Y:=4: x:=9:

soln := fsolve({eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9, eq10, eq11, eq12, eq13, eq14}, {a, b, c, d, e, f, g, h, q, s, t, u, v, z});

      soln := {a = -0.09239258218, b = 0.02046544085, c = -40.00746249, d = 26.68993307, e = 0.3933087206,       f =0.2819127969, g = -1.730438481, h = 1.364657560, q = 10.17990179, s = 1.409139234, t =      8.813294145, u = -0.1946342314, v = 0.3835278957, z = -2.668688921}

 

Sol := dsolve(Sys, numeric, output = listprocedure):

y2 := eval(y2(t), Sol):

y3 := eval(y3(t), Sol):

Now you can use  y2  and  y3  as  usual functions:

plot(abs(y2(t)-y3(t)), t = 0 .. 10);

Optimization[Maximize](abs(y2(t)-y3(t)), t = 0 .. 10);

                    [0.478412603974697, [t = 1.55119226446816]]

g(y):=80*y^8 + 68*y^6 + 12*y^4 -4*y^2 -1;

p(y):=RandomTools[Generate](polynom(integer(range=1..20), y, degree=10));

Sol:=[solve(g(y))];

is(subs(y=Sol[3], p(y)*g(y))=0);

 

 

The set of points  z  is a circle of radius 3 centered at point  -3+2*I . The set of points  w  is this circle translated by the vector  1+3*I .

restart;

Set:=abs(z+3-2*I)=3:

A:=plots[implicitplot](subs(z=x+I*y,Set), x=-10..5,y=-5..10, color=red, thickness=2): # set of points z

w:=solve((x+I*y) - z = 1 +3*I, z):

B:=plots[implicitplot](subs(z=w,Set), x=-10..5,y=-5..10, color=blue, thickness=2): # set of points w

plots[display](A,B, scaling=constrained); 

 

 

First 238 239 240 241 242 243 244 Last Page 240 of 290