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
  • I want to set up a symbolic integration procedure over an region. I will have expressions such as z = c1 + c2*x + c3*y + c4*x*y .. but the number of terms in z can vary and should be determined automatically by the procedure. c1, c2 .. are arbitrary factors. For example, a possible z could be z = a + b/c*x + d/e*x*y^3 + f*y^5. The integral of z should be returned from the procedure as zint = c1*INT(0,0) + c2*INT(1,0) + c3*INT(0,1) + c4*INT(1,1) .. where INT(i,j) represents the integral over the region of x^i*y^j. These integrals will be calculated numerically by another procedure. Does anyone know how to do this?
    I am new to Maple and am trying to create some plots. I can create plots using the Plot builder with ease but would like to have plots generated within a loop. I am having success creating 3d plots within the loop but only want 2d plots. My expression is in 2-variables and I am rotating the graph as a change angles. Any help would be appreciated. Kay
    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
    First 214 215 216 217 218 219 220 Last Page 216 of 307