Kitonum

21435 Reputation

26 Badges

17 years, 29 days

MaplePrimes Activity


These are answers submitted by Kitonum

I do not understand the meaning of the problem. If you want to write it in the same loop then 

for i in  [seq(i, i=0..100, 0.2), seq(i, i=100..0, -0.2)]  do ... od;

Multiplication signs, division sign and missing parenthesis

((5*x^2*y^2)-6*x^4)/((1-y^2)*(x^2+y^2)-(y^2*(1-x^2-y^2)));

 

The parenthesis can be put in another place.

 

This is arithmetical progression.

f:=unapply(rsolve({u(n+1)=u(n)+d, u(1)=a}, u(n))/b, n);

                              f := n -> (a+d*(n+1)-2*d)/b

 

Example:

eval(f(100000000000), {a=25, d=25, b=5});

                                         500000000000

Look at my posts   http://www.mapleprimes.com/users/Kitonum/posts 

You can find a number of interesting applications of them.

You can use geometric transformations from  plottools  package.

Examples:

with(plottools): with(plots):

F:=curve([[-4,0],[0,3],[1/2,0], [-4,0]], thickness=3):

F1:=reflect(F, [[-1,4],[1,4]]):

F2:=translate(F, -4, 2):

F3:=rotate(F, -Pi/2, [3,0]):

T:=textplot([[-1,1,"F"], [-1,7,"F1"], [-5,3,"F2"], [4,4,"F3"]], font=[TIMES,ROMAN,20], color=blue):

display(F, F1, F2, F3, T, scaling=constrained);

 

 

Code of procedure:

ExponentOfPower:=proc(monom, var)

`if`(not has(monom,var), 0,  `if`(nops(select(has,monom,var))>1, op(2,select(has,combine(monom),var)), 1));

end:

 

Examples:

term1:=3*x^k*y^(k+2): term2:=3*y^(k+2): term3:=3*x*y^(k+2): term4:=3*x^k*y^(k+2)*x^2:

op(map(ExponentOfPower, [term||(1..4)], x));

                                                                        k, 0, 1, k+2

 

Example with Carl's procedure:

power(x^x, x);

             x*ln(x)+x

f := t->piecewise(0 < t and t < 10, 1-t, 10 < t, t);

plot([f(t), [10, t, t = -9 .. 10]], t = 0 .. 15, thickness = [2, 1], color = [red, black], linestyle = [1, 2], discont, view = [-2.5 .. 14.5, -10 .. 14.5], scaling = constrained);

 

 

term:=3*x^k*y^(k+2):

op(2, select(has, term, x)),   op(2, select(has, term, y));

                                                  k, k+2

There is no triangle with sides 136, 170, 174, in which the coordinates of all vertices are integers or rational numbers. It is well known that the area of any such triangle is rational. But the area of your triangle is irrational:

a := 136: b := 170: c := 174:

p:=(a+b+c)/2:

sqrt(p*(p-a)*(p-b)*(p-c));

                                        240*2002^(1/2)

Tools -> Options -> Precision -> Round calculation ... -> Apply to Session or Apply Globally

1) Your code is very inefficient. To specify the sequence of the objects is better to use the  seq  command. Also I do not understand the meaning of the options  coords=polar, axiscoordinates=polar, as your circles given in Cartesian coordinates.

with(plots): with(plottools):

c := seq(circle([i/(1+i), 0], 1/(1+i), color = green), i=1..20):

d := seq(circle([1, 1/i], 1/i, color = blue), i=1..20);

display(c, d, view = [0 .. 2, -0.5 .. 2], scaling=constrained);

 

 

2) intersect command works only with finite sets. In order to find the point of intersection of the two lines, you can use solve  command.

Sol := solve({(x-1)^2+(y-1)^2 = 1, (x-2/3)^2+y^2 = 1/9}, explicit);

                        {x = 1, y = 0}, {x = 2/5, y = 1/5}

Point1 := disk([rhs(Sol[1, 1]), rhs(Sol[1, 2])], 0.01, color = red):

Point2 := disk([rhs(Sol[2, 1]), rhs(Sol[2, 2])], 0.01, color = red):

display(L, LL, Point1, Point2, view = [0 .. 1.5, -0.5 .. 0.5], scaling = constrained);

 

Edited. Fixed equation of  .

 

Your equation has infinitely many solutions for any real  n>0:

RealDomain[solve](3^x/2^y = n, {x, y});

              {x = (ln(n)+ln(2)*y)/ln(3), y = y}

 

As  y  you can take any number, ie the set of solutions depends on a single parameter.

You can easily place this idea as a procedure. Procedure  Round  rounds each number float type in expression  expr   to  n  digits after decimal point.

Round:=proc(expr, n)

local F;

uses StringTools;

F:=x->parse(sprintf(Substitute("%.nf", "n", convert(n, string)), x));

subsindets(expr, float, F);

end proc;

 

Examples:

Round(Vector([1.235, 0.1237]), 2);

Round(1.156*x^2-12*x+0.533, 1);

 

 

 

 

 

See acer's answer here

 

a:=0.0000000000000000000000213123123:

parse(sprintf("%.3f", a));

                                        0.000

Plots := proc (L, C)  # L - the list of exponents, C - the list of colors

local k, f, M;

f := (x, n)->1+2*(1+x)^n;

M := mul(f(5, k), k = L)^(1/nops(L));

print(plots:-display(Array([seq(plot(f(x, L[k]), x = 0 .. 5, 0 .. M, color = C[k], caption = typeset("The exponent   ", n = L[k])), k = 1 .. nops(L))])));

plot([seq(f(x, k), k = L)], x = 0 .. 5, 0 .. M, color = C, legend = [seq(n = k, k = L)]);

end proc;

 

Example:

Plots([0, 1, 2, 3], [yellow, green, blue, red]);

First 236 237 238 239 240 241 242 Last Page 238 of 289