vv

12453 Reputation

19 Badges

9 years, 279 days

MaplePrimes Activity


These are replies submitted by vv

@Guy1  The idea is to avoid Maple's light, ambientlight or lightmodel, and use color as in my example. E.g. to change the direction of light, just change light:=[-1/sqrt(3),-1/sqrt(3),1/sqrt(3)].
For a secondary light source, take two lists light1 and ligt2 and combine them. There are many computer graphics methods, but probably Maple is not the best tool for such effects.

 

@Lynge Jensen
OK, but Maple does not know about turbineblades and your assumptions. 

int((x+1)^2, x) = int(x^2 + 2*x + 1, x);

@Kitonum You took another expression instead of  ln(piecewise(t = 0, 2, 0 < t, 2 + 5*t)).
Yours is simply ln(2 + 5*t)

 

@Carl Love You are right about  Gershgorin ==> spectral radius(stochastic) <= 1. I was fooled by the standard proof.

The OP's M seems however to have r=1.

@MapleEnthusiast 
1. The "how" answer is useless. What linear system?
Suppose e.g. that we start with a stochastic matrix S having some symbolic elements. If P is an arbitrary nonsingular matrix also with some symbolic elements then P^(-1).S.P has the spectral radius <= 1 but it will be very hard to prove it without knowing S and P.

2. A Neumann series ( = Sum(A^k, k=0..infinity)) cannot converge if A's spectral radius is >= 1.

@MapleEnthusiast The Gershgorin theorem is too simple to hope for a proof. It is useless even to prove the result for standard stochastic matrices. It would be more important to explain how (and why) the matrix M was obtained.

@Carl Love An interesting (and strange) fact:

restart;
Digits:= 15:
Sin:= proc(x::realcons)
    Digits:= 2;
    evalf(sin(x))
end proc
:
evalf(Int(Sin, 0..1*Pi/2, method= _d01ajc));
#                        1.00000000000000

So, sin has been computed with 2 digits precision and the result is "perfect".

Compare with:

restart;
Digits:= 15:
Sin:= proc(x::realcons)
    Digits:= 20;
    evalf(round(1000*sin(x))/1000)
end proc
:
evalf(Int(Sin, 0..Pi/2, method= _d01ajc));
#Error, (in evalf/int) NE_QUAD_MAX_SUBDIV:
#  The maximum number of subdivisions has
#  been reached: max_num_subint = 200

evalf(Int(Sin, 0..Pi/2, method= _d01ajc, epsilon=1e-4)); 
                        1.00000605573377

 

@Carl Love It is not a very good idea to do so. It will not work for nonlinear equations, and even for linear ones, some solutions could be lost. E.g.  2*x=4  mod 16.

@mthkvv The situation is more complicated. Some authors take different branches, such that the result is complex for nu>1, 0<k<1 (see e.g. Oldham K., Myland J., Spanier J. - An Atlas of Functions, Springer, 2009).
Unfortunately, Maple's documentation does not contain the details.

@acer @Carl Love  thank you both. It would be nice to know whether there was a good reason for this construct, or it's just for fun. In the latter case, let's hope that at least option encrypted will not be used.

Edit. For combinat:-numbpart more similar constructs are used:

kkk := [op(7, eval(combinat:-numbpart))]:
showstat(kkk[4][NumberOfPartitions]);

revealing some undocumented options.

@acer  Thank you, this is very interesting. My impression was that the lexical table is used only for internal purposes.
I wonder why a procedure would be placed here.
Your example would be greatly appreciated.

@Carl Love  The procedure combinat:-partition simply calls partition1(n,m) . This is not an export, local or library proc and I was not able to find it. Do you know something about it?

@Carl Love  Yes, you are right. Yesterday it was late and I had not the time to test it.
Here is a version a bit faster.

NumPartStrict1:=proc(n, m)
  option remember;
  local k;
  if m=0 then return `if`(n=0,1,0) fi;
  if m*(m+1)<2*n then return 0 fi;
  if m>=n then return 1 + thisproc(n,n-1) fi;
  add(thisproc(n-m+k-1,m-k),k=1..m)
end:

CodeTools:-Usage(NumPartStrict1(2000,100));
memory used=159.09MiB, alloc change=76.01MiB, cpu time=2.77s, real time=2.76s, gc time=93.75ms

                  344032826568833636909684517

 

Please provide a more detailed statement of the problem.

@Aliocha  It's of course possible to use LineInt, but then you must enter the correct complex components for the vector (otherwise the result is always real). As you see, using int is simpler.

First 19 20 21 22 23 24 25 Last Page 21 of 166