vv

14027 Reputation

20 Badges

10 years, 54 days

MaplePrimes Activity


These are replies submitted by vv

@greatpet I don't know why uses does not work in this form. But it does with "equations" (which is actually more clear and allows abbreviations):

restart;
OM := module()
option packge;
export IM:= module()
    option package;
    export add_three := x-> x+3;
    end module;
export times_two_add_three:= 
  proc(x)
    uses k=IM;
    k:-add_three(2*x);
  end;
end module:
OM:-times_two_add_three(z);

 

@greatpet with cannot be used inside modules and procs. Use the uses clause instead.

@greatpet You may simply write

export procedure1 := IM1:-procedure1;
etc.

E.g. in Carl's example:

restart;
OM:= module()
option package;
export
    IM:= module()
    option package;
    export add_three:= x-> x+3;
    end module;
export add_three:=IM:-add_three;
end module:

with(OM);
#                        [IM, add_three]

add_three(z);
#                             z + 3

 

@mmcdara Yes, I wanted minimal modifications of the previous answer (for ratpoly).
The unpleasant fact is that solve finds only the solutions with c=0.

@tomleslie Actually I was aware that Excel throws an error for x*m<0 but I don't understand why and I have preferred the simplicity. After all, we may say: Excel is unable to compute MROUND(x,m) when x*m<0.

@mmcdara Merci. For my native Romanian the term is perfect :-)

I am not sure whether this is the right forum for such questions. Better choices could be https://math.stackexchange.com or https://mathoverflow.net. A CAS cannot help much when a proof needs more or less special theorems/formulae to be applied. For example, Maple cannot manage the limit of a sequence: limit(h(n), n = infinity) assuming n::even.

@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.

First 29 30 31 32 33 34 35 Last Page 31 of 177