Kitonum

20084 Reputation

26 Badges

17 years, 23 days

MaplePrimes Activity


These are replies submitted by Kitonum

@Anthrazit  If you do not want to use custom procedures, then first run  interface(displayprecision=n):  command, where   is the number of digits that you want after the decimal point.

Example of use:
interface(displayprecision=3):
evalf(Pi);
                                     
 3.142


See help on the interface command for details.

@anthonyfl  Very small changes to the code will be required. The animation parameter will be  x  not  y :

restart;
f:=x^(1/2):
g:=x^2/8:
X:=r*cos(phi): Y:=r*sin(phi):
P:=plot3d(eval([[X,Y,f],[X,Y,g]],x=r), r=0..4, phi=0..2*Pi, style=surface, color=["Khaki","LightBlue"], scaling=constrained, axes=normal, labels=[z,x,y], orientation=[20,80], transparency=0.3):
F:=x->plots:-display(plot3d([[X,Y,x^2/8],[X,Y,sqrt(x)]], r=x..x+h, phi=0..2*Pi, style=surface, color=gold), plot3d([eval([X,Y,H],r=x),eval([X,Y,H],r=x+h)], H=x^2/8..sqrt(x), phi=0..2*Pi, style=surface, color=gold)):
h:=0.15:
plots:-animate(F,[x], x=0..4-h, frames=60, background=P);

                      

 

@JAMET  I have updated my worksheet according to your wishes.

@dharr  Thank you! I did not know that  add  works on matrices. It probably appeared in recent versions of Maple.

@Carl Love First I took the function  x->(x^3-x)*(x^2+1)/(x^4+1)  whose zeros are  -1, 0, 1  and the oblique asymptote is y=x  and then made the obvious change  x->-(x-2)

@tomleslie 

kernelopts(version);

        Maple 2018.2, X86 64 WINDOWS, Oct 23 2018, Build ID 1356656


This error also occurred to me in earlier versions.

@tomleslie  Your code does not work in Maple 2018.2 and probably in many earlier versions. This is a famous bug. But there is a simple workaround. You just need to increase  Digits .
 

restart; with(Optimization)

LPSolve(5*x1+2*x2+7*x3+6*x4+x5+6*x6+8*x7+6*x8, {10*x1+9*x2+15*x3+3*x4+11*x5+6*x6+3*x7+4*x8 <= 22}, assume = {integer, nonnegative}, maximize = true)

Warning, problem appears to be unbounded

 

[0, [x1 = 0, x2 = 0, x3 = 0, x4 = 0, x5 = 0, x6 = 0, x7 = 0, x8 = 0]]

(1)

NULL

Digits:=20:
LPSolve(5*x1+2*x2+7*x3+6*x4+x5+6*x6+8*x7+6*x8, {10*x1+9*x2+15*x3+3*x4+11*x5+6*x6+3*x7+4*x8 <= 22}, assume = {integer, nonnegative}, maximize = true);

[56, [x1 = 0, x2 = 0, x3 = 0, x4 = 0, x5 = 0, x6 = 0, x7 = 7, x8 = 0]]

(2)

``


 

Download intOpt_new.mw

Your code does not work, because the grid is not small enough. See help about  gridrefine  option in  plots:-implicitplot . The following code works:

restart; 
with(plots, implicitplot):
implicitplot(2+r*(b-2)*sqrt(b-1), b = -10 .. 10, r = -10 .. 10, scaling = constrained, gridrefine = 3);

 

@Ali Guzel  See update to my answer above.

@acer  I used another way to estimate the time, because

CodeTools:-Usage(Student:-Calculus1:-Roots(Eq, x=3*Pi/2..5*Pi)); 

hangs on my computer (I use Maple 2018.2)

Read this article  https://en.wikipedia.org/wiki/Euler_method  before writing your program. I think you yourself do not really understand what you wrote.

The polynomial is more convenient to specify as a procedure:

P := x -> a0*x^3+a1*x^2+a2*x+a3:

You have 4 unknown coefficients and 4 conditions. Make a system of equations to find them.

@Rouben Rostamian   Of course, it’s good for everyone to know that this is called the shoelace formula  https://en.wikipedia.org/wiki/Shoelace_formula 

restart:
Fib:= proc(n)
option remember;
    if n=1 then return 1
    elif n=2 then return 2
    else Fib(n-1)+Fib(n-2)
    fi;
end proc:

Fib(30);

 

@goli Do you want several arrows on one curve?

A:=plot(x^2, x=0..3, color=red, thickness=3):
x0:=1.5:
B:=seq(plots:-arrow([x0,x0^2], 0.7*[1,2*x0], color=blue, head_width=0.15, head_length=0.4, shape=arrow), x0=[0.5,1.5,2.2]):
plots:-display(A, B);

          

 

First 16 17 18 19 20 21 22 Last Page 18 of 126