MaplePrimes Posts

MaplePrimes Posts are for sharing your experiences, techniques and opinions about Maple, MapleSim and related products, as well as general interests in math and computing.

Latest Post
  • Latest Posts Feed
  • Inspired by the blog post Find a point in every region defined by a system of linear equations, I have come up with the following method to find a point inside each bounded region. The assumptions are:
    • No two lines are parallel.
    • No three lines are coincident.
    Due to numerical instability, it seems, using floats, the coefficients of the equations of the lines are taken to be integers (they could also have been taken to be fractions, of course). Then the method goes like follows:
    We're running Maple 11 in a lab of about 40 MiniMacs (MacOS X). Normally, there is a Preferences choice under Maple 11 on the menu. But one student had no Preferences there (or anywhere else that I could find: in particular, not under Tools, where Options would be under Windows). What's going on?
    We are pleased to announce the winner of the monthly Maple Mentors Awards for December. The winner for December is Acer. Acer will receive a prize of his choice to thank him for his involvement with the MaplePrimes community. Congratulations and keep up the good work!!
    I occasionally use e.g. expr := 1+a^2; eval( expr, 2=-1 ); to convert expr to 1+1/a. I realised recently that this can be dangerous: expr2 := 1+x+3*y; eval(expr2, 1=2); produces (rather suprisingly) 4+2x+3y. Investigating, pulling apart expr2 with op reveals the structure as being a sum of 3 terms, the last being a product. "ToInert" shows essentially the same. "dismantle" however shows expr 2 as being a single sum of the form 1.1 + 1.x + 3.y. So it is essentially the dismantle version that eval searches and replaces all the 1's by 2's. My question is whether there is some good reason for this. It would seem to me (without knowing much about the theory of computer algebra) that eval (and subs) should work on the operands as revealed by op or ToInert. Certainly it would lead to more logical results in cases like my example.
    I am coloring the xy plane, by using a procedure(x,y) to assign color. The procedure returns a number and color is assigned according to that number. It works fine but I really want some of the points to be colored BLACK. What numerical value do I use for BLACK? WHITE?

    I have written a module based Maple expressions to LaTeX converter which can handle the following nested (as given by ToInert) inert types:

    _Inert_RATIONAL, _Inert_COMPLEX, _Inert_NAME, _Inert_SUM, _Inert_PROD, _Inert_POWER, _Inert_SET, _Inert_LIST, _Inert_FUNCTION, _Inert_MATRIX, _Inert_VECTOR_COLUMN, _Inert_VECTOR_ROW, _Inert_TABLEREF.

    As a somewhat cruel test example consider

    expr := Matrix(2,2,(i,j) ->
    	-(-x)^(-i/2+c)*sin(x)^(-j)*(a+I*b)^((i-j)/2)
    	+f({-i,j})/g([-i,j])
    	+m[i,j]
    );
    newLatex:-Latex(expr);
    

    which yields

    Inspired by the post "finding the Hessian (third order tensor) and higher order derivatives", I have written the following function which treats gradients, Jacobians, Hessians, and higher order derivatives in a unified way, implementing tensors as multidimensional Arrays:
    multiDiff := proc(expr::Array(algebraic),vars::list(symbol),n::posint)
       local i,result;
       if n > 1 then result := multiDiff(multiDiff(expr,vars,n - 1),vars,1)
       else
          result := Array(ArrayDims(expr),1..nops(vars),order = C_order);
    
    The recipe is quite simple to understand looking at an example (and it is understood best by having paper and pencil to follow it): f:= x -> x^2 the parabola with its inverse g:= y -> sqrt(y). Say you want the integral of g over 0 ... 2, which (here) is the area between the graph and its horizontal axis. That is the same as the area of the rectangle minus the area between the graph of g and the vertical axis, where the rectangle has corners 0, 2 and g(0)= f^(-1)(0) and g(2)= f^(-1)(2). Now recall the geometric interpretation of the compositional inverse of a function: it is reflection at the diagonal.
    I was solving a task in flow through a pipe and noticed a result from int where floats were changed into a RootOf containing integers and fractions. I was surprised by the result. Here is a very simple example: f:=z->solve(y/(1.+(-0.5*y)^0.8)=z,y); v:=x->int(f,-10..x); v(-1); Is it common for Maple to change floats into integers and fractions for symbolic analysis? It seems to violate the rules. Thanks, Lee View 4238_Odd Solve Example.mw on MapleNet or
    What is the canonical (and therefore also safe) way to pull out a specific argument of a function contained in the nested output from ToInert? I ask because it seems that using something like op(n1...,op(nk,ToInert(expr))...), where n1...nk are positive integers, is a bad idea because the arguments can change locations depending on the exact expression being translated to inert form. For instance, inserting a specific shape in the Matrix constructor changes locations of all the other arguments of _Inert_MATRIX. Is it using iteratively something along the following lines?
    I want learn maple well. do my best to it.
    Is there a size limit on the matrices and vectors? In case there is one, is it possible to extend this limitation?
    I've done a proc to produce a list of compound Poisson random variables as below, but it's not fast enough. I suspect there are better ways to do the same. Comments and solutions welcome! with(Statistics): FFFF := proc (g) local i, x, y, S; for i to g do x[i] := floor(convert(Sample(RandomVariable(Poisson(1)), 1), `+`)); if 0
    Recently Dr. Israel responded to my request for help in extending the EllipticF function past the limit of Pi/2 for the amplitude (see topic titled Elliptic Integrals). After reviewing A&S Chapter 17, I have tried to duplicate the results using the JacobiAM function in Maple. The help page for this function indicates that there is no limit on the amplitude. The attached worksheet evaluates the form suggested by A&S, Eq. 17.4.3 and the JacobiAM function. It is interesting to note the only when the argument given to the EllipticF function is equal to the remainder of Pi/2 - beta that the two expressions are equal. I would think that the JacobiAM form is a more compact representation of EllipticF for amplitudes greater than Pi/2. Are the two functions equivalent as used in the worksheet?
    Hello people. I tried to plot the graph plot(sqrt(sin(x))/sqrt(cos(x))) and I believe it was wrong. The graph was different from the one my Ti gave. So I went online and check with a third party online grapher: http://www.walterzorn.com/grapher/grapher_e.htm and do some calculation on my own. I believe Maple's was wrong. Any idea? Thanks.
    First 213 214 215 216 217 218 219 Last Page 215 of 306