Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 356 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@coopersj In addition to Tom's cabbages example, I'd guess that LinearAlgebra is more commonly used for error computations where the infinity norm is most appropriate.

You can change the default, like this:

origNorm:= eval(LinearAlgebra:-Norm):
unprotect(LinearAlgebra:-Norm):
LinearAlgebra:-Norm:= proc(v, p:= 2) origNorm(v, p) end proc:
protect(LinearAlgebra:-Norm, origNorm);

LinearAlgebra:-Norm(<3,4>);
                               5

Something like this could be put into an initialization file.

@Muhammad Usman If it's known that the integrals are always 0 or Pi^(-3/2), then crude numeric integration at 1-digit precision can distinguish those cases. One of the "Cuba" methods of numeric integration could be used.

@dim____ Make sure that you're using rhs~ instead of plain rhs.

@Carl Love The answer above uses features introduced in Maple 2019. The following is almost as short, and will work in older Maple:

P:= [0,0]: R:= rand(1..4): 
plot(ListTools:-PartialSums([P, seq([[-1,0],[1,0],[0,-1],[0,1]][R()], 1..10000)]));

 

@acer I agree: When style= pointline is used with a function rather than a discrete set of points, the number of points shown should be much fewer than the number of used for the line.

@MapleEnthusiast Multiplying the pseudo-inverse by the right-side vector gives you only one of the infinitude of solutions. This may be the reason for your "disconnect". I believe (not sure) that it gives a solution of minimal 2-norm.

@Kitonum Yes, certainly your first version is easier to understand than mine. (My primary motivation is usually avoiding repetition.) Your second version is fine for a very smooth curve, as shown, but probably not so great for a less smooth curve. 

@Joe Riel Vote up. I've used the types And(specfunc(...), patfunc(..)) and And(typefunc(...), patfunc(...)) so many times that I wonder why there's not a predefined single type that does it.

@imparter Like this:

plots:-display(
    map(
        L-> plot(sin(x), x= -Pi..Pi, L[]),
        [[linestyle= solid],
         [style= point, symbol= box, numpoints= 16, adaptive= false]
        ]
    )
);

The fact that the options stepsize and minstep exist suggests that there are known to be cases where they are needed to get accurate results. 

 

@RohanKarthik 45*x does not satisfy the condition degree(..., x) - degree(..., y) equals 0 or -1.

@Yiannis Galidakis When y is integer, there are many variations possible for the depth of the evaluation. One possibility is to have hy(5, 2, 4) return 2^(2^(2^hy(4, 2, 65533))). Of course, you want to avoid towers of exponents that are too tall to display.

@Yiannis Galidakis The following should work in Maple 13. It only took me 5 minutes to make the changes.

`print/%^`:= (a,b)-> ``(a)^b:
`print/%*`:= (a,b)-> ``(a)*``(b):
`value/%^`:= `^`:
`value/%*`:= `*`:

hy:= proc(n, x, y)
    if n=0 then y + 1
    elif n=1 then x + y
    elif y=0 then 1
    elif y=1 then x
    elif n=2 then `%*`(x,y)
    elif n=3 then `%^`(x,y)
    elif n=4 then 
        if y::posint then `%^`(x, procname(4, x, y-1))
        else `%^`(x, 'procname'(4, x, y-1))
        fi
    elif [n,y]::list(posint) then procname(n-1, x, procname(n, x, y-1))
    else 'procname'(n-1, x, 'procname'(n, x, y-1))
    fi
end proc
:
hy(4, 2, 4);
value(%);
                             65536


 

@Yiannis Galidakis Your code in the Reply immediately above makes no distinction between numeric and symbolic y, and thus I can't see how it addresses your Question about recursion. Rather than retrofitting my code to Maple 13, it seems like you're ignoring its most important features.

For how long will you be stuck with just Maple 13?

Like I've told you before: When you say that something is not working, show an example of it not working, not just an example of it working! It's okay to show an example of it working if in addition you show an example of it not working.

First 157 158 159 160 161 162 163 Last Page 159 of 709