Kitonum

21445 Reputation

26 Badges

17 years, 46 days

MaplePrimes Activity


These are answers submitted by Kitonum

Red arrows (tangent vectors) show the direction of increasing parameter:
 

f:=[t-2,(t-2)^2];
df:=diff(f, t);

[t-2, (t-2)^2]

 

[1, 2*t-4]

(1)

P:=plot([op(f), t=-0.5..4.5], color=blue):
V:=plots:-arrow([seq([f, df], t=0..4)], length=1, color=red, border=false):
plots:-display(P,V, scaling=constrained, size=[400,500]);

 

 


 

Download arrows1.mw

Try the following:

plot([x+deltax, z, x=0..l]);
 

Here is the plot that OP wished according to his link:

restart;
f:=x->sqrt(1-x^2):
g:=x->-sqrt(1-x^2):
y1:=f(a)+D(f)(a)*(x-a):
y2:=g(a)+D(g)(a)*(x-a):
y3:=[-1,t,t=-1.5..1.5]:
y4:=[1,t,t=-1.5..1.5]:
Opt:=x=-2..2,color="Blue":
plots:-display(plot([seq(op([y1,y2]),a=-0.99..0.99,0.02)],Opt),plot([y3,y4],Opt), view=[-2..2,-1.5..1.5], scaling=constrained, size=[700,500],tickmarks=[spacing(0.5),spacing(0.5)],  axis[1]=[gridlines=40], axis[2]=[gridlines=30]);


Output:
                    

 

 

L := [8,7,9,12];
L1:=[seq([i, L[i]], i=1..nops(L))];
map(t->t[1], sort(L1, (x,y)->y[2]<x[2]));

 

Your second result obtained with erroneous syntax (numeric option is  misplaced) is incorrect. To test this, I did both calculations for  T=1, after making some simplifications to your commands (Pi should be instead of pi, and also removed some commands and options that do not affect the result). I don't know how Maple could get it but the second result is also erroneous because the integral in which the integrand is positive must also be positive.

 

restart;

(2/Pi)^(1/2)*int((exp(-32.74123792568-0.8916456579806e-1*ln(4.852623952*10^9*v^2)))*exp(-v^2/(2*T))*v^3, v = 2 .. 100, numeric);
evalf(eval(%,T=1)); # The value of the integral for T=1

2^(1/2)*(1/Pi)^(1/2)*(int(exp(-32.74123793-0.8916456580e-1*ln(4852623952.*v^2))*exp(-.5000000000*v^2/T)*v^3, v = 2. .. 100.))

 

0.4544054310e-15

(1)

(2/Pi)^(1/2)*int((exp(-32.74123792568-0.8916456579806e-1*ln(4.852623952*10^9*v^2)), numeric)*exp(-v^2/(2*T))*v^3, v = 2 .. 100);
evalf(eval(%, T=1)); # It's incorrect result

0.2737688896e-1*2^(1/2)*(1/Pi)^(1/2)*T*exp(-0.8000000000e-10*(0.4092654741e12*T+0.6250000000e14)/T)*(-4.438382806*exp(5000./T)*T+8.837258978*exp(4998./T)*T+17.67451796*exp(4998./T)-4.398876172*T-21994.38086)

 

-0.1121012454e-15

(2)

 

``


 

Download int_(2)_new.mw

What function do you call monotonically increasing (or monotonically decreasing) on some multidimensional set? The issue is that there is a natural order on the number axis: for any two different points, we know for sure which one is greater. And in multidimensional space? For example, on 2D which point is greater: (0,1) or (1,0)?

I do not understand why such a complicated code (nested loops and etc.) for a simple task. You can immediately build all the necessary plots, if you know their equations, and then get the data using  plottools:-getdata  command:

restart;  
H:= 3+2*tanh(x-6);
P:=plot([H, -H, 0], x=0..10, linestyle=[1,1,3], color=black, thickness=[2,2,0], view=[-1..12,-6..6], axes=box);
interface(rtablesize=1000);
map(t->t[3],[plottools:-getdata(P)]);


 

restart;
f:=ln((1-x)^2*(x+1)^2/((-I*x-I+sqrt(-x^2+1))^2*(I*x+I+sqrt(-x^2+1))^2));
applyop(t->numer(t)/expand(denom(t)), 1, f);
simplify(%);
applyrule(ln((-1+x)^2)=2*ln(abs(x-1)), %);
sort(%);
                


Edit.
                    

I do not know of any way to solve these examples in Maple in the above formulation. The first 2 examples can be easily solved using  isolve  command to solve equations in integers:
 

restart;

isolve(2*n>n+2);
about(_NN1);

{n = 3+_NN1}

 

Originally _NN1, renamed _NN1~:
  is assumed to be: AndProp(integer,RealRange(0,infinity))

 

isolve((3*n+1)/2=m);

{m = 2+3*_Z1, n = 1+2*_Z1}

(1)

 


We see that the first assertion is true for any integer greater than or equal to 3, and the second one is true for an infinite set of integers depending on the integer parameter  _Z1

Download prop.mw

Perhaps you mean Puiseux series, which, for example, allow locally to obtain individual branches of algebraic functions near specific points. These expansions may have fractional exponents.

Example:

with(algcurves):
f:=x^3+y^3-3*x*y;
plots:-implicitplot(f, x = -3 .. 3, y = -3 .. 3, gridrefine = 5);
puiseux(f, x = 0, y, 6);
                          


See the quality of the approximation on the plot:
f:=x^3+y^3-3*x*y;
A:=plots:-implicitplot(f, x = -3 .. 3, y = -3 .. 3, gridrefine = 5):
P:=algcurves:-puiseux(f, x = 0, y, 6);
B:=plot([P[]], x = -2 .. 2,color=[red,blue], thickness=2):
plots:-display(A,B, scaling=constrained);

 

Also see help on  ?examples, algcurve

R:=z-> 1-cos(Pi*z)^2;
for z from 0 to 1 by 0.1 do
R(z);
od;

You can first define lists of desired arrows and their colors, and then plot them together:

Example:

with(plots):
with(LinearAlgebra):
with(ColorTools):
r:=rand(-10..10):
v:=[seq(<r(),r()>, i=1..4)];
C:=[seq(Color(evalf(Norm(v[i],2)/max(seq(Norm(v[k],2), k=1..4))*~[0,0,1])), i=1..4)];
display(seq(arrow(v[i],width=0.5,length=20, color=C[i]), i=1..4), scaling=constrained);


Edit.

Expr:=2*((-1)^n-1)*sin(n*Pi*x)*exp(-Pi^2*n^2*t)/(Pi*n);
plot3d(Sum(Expr, n=1..20), x=0..2*Pi, t=0..0.5, axes=normal, numpoints=10000);
plot(eval(Sum(Expr, n=1..20), t=0.1), x=0..2*Pi, numpoints=1000); # Plot for t=0.1
plot3d(eval(Expr, n=1), x=0..2*Pi, t=0..0.5, axes=normal, numpoints=10000);  # Plot for n=1

 

L1 := [{3,5},{4,3},{4,6},{3,2},{2,6}]:
L2 := [1,5,4]:
`or`(seq(has(L1, i), i=L2));
                                                          
true

restart;
GED2 := proc(n1, n2) 
option remember; 
do 
   if n2 = 0 then return n1 else 
   return GED2(n2, n1 mod n2)
   end if;
end do;
end proc:

Example of use:
GED2(32, 52);
                               
4


Edit. Obviously, the code above can be simplified, since there is no need in  od, end od  and in the second  return :

restart;
GED2 := proc(n1, n2) 
option remember; 
   if n2 = 0 then return n1 else 
   GED2(n2, n1 mod n2)
   end if;
end proc:

 

First 98 99 100 101 102 103 104 Last Page 100 of 289