Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Here is a hacked-up and short `convert/identifier` procedure.

The shortness of the procedure should is a hint that it's not super robust. But it can be handy, in some simple display situations.

If I had made into a single procedure (named `G`, or whatever) then I could have declared its first parameter as x::uneval and thus avoided the need for placing single-right (uneval) quotes around certain examples. But for fun I wanted it to be an extension of `convert`. And while I could code special-evaluation rules on my `convert` extension I suppose that there no point in doing so since `convert` itself doesn't have such rules.

For the first two examples below I also typed in the equivalent expressions in 2D Math input mode, and then used the right-click context-menu to convert to Atomic Identifier. Some simple items come out the same, while some other come out with a different underlying structure and display.

 

restart:

`convert/identifier`:=proc(x)
   cat(`#`,convert(convert(:-Typesetting:-Typeset(x),`global`),name));
end proc:

convert( 'sqrt(4)', identifier);

`#msqrt(mn("4"))`

eval(value(%));
lprint(%);

`#msqrt(mn("4"))`

`#msqrt(mn("4"))`

`#msqrt(mn("4"))`

`#msqrt(mn("4"))`

lprint(%);

`#msqrt(mn("4"))`

convert( 'int(BesselJ(0,Pi*sqrt(t)),t)', identifier);

`#mrow(mo("∫"),mrow(msub(mi("J",fontstyle = "normal",msemantics = "BesselJ"),mn("0")),mo("⁡"),mfenced(mrow(mi("π"),mo("⁢"),msqrt(mi("t"))))),mspace(width = "0.3em"),mo("ⅆ"),mi("t"))`

eval(value(%));
#lprint(%);

`#mrow(mo("∫"),mrow(msub(mi("J",fontstyle = "normal",msemantics = "BesselJ"),mn("0")),mo("⁡"),mfenced(mrow(mi("π"),mo("⁢"),msqrt(mi("t"))))),mspace(width = "0.3em"),mo("ⅆ"),mi("t"))`

`#mrow(mo("∫"),msub(mo("J"),mn("0")),mfenced(mrow(mi("π",fontstyle = "normal"),mo("⁢"),msqrt(mi("t")))),mo("⁢"),mo("ⅆ"),mi("t"))`

`#mrow(mo("∫"),msub(mo("J"),mn("0")),mfenced(mrow(mi("π",fontstyle = "normal"),mo("⁢"),msqrt(mi("t")))),mo("⁢"),mo("ⅆ"),mi("t"))`

#lprint(%);

convert( Vector[row](['Zeta(0.5)', a.b.c, 'limit(sin(x)/x,x=0)', q*s*t]), identifier);

Vector[row](4, {(1) = Zeta(.5), (2) = a.b.c, (3) = limit(sin(x)/x, x = 0), (4) = q*s*t})

eval(value(%));
#lprint(%);

Vector[row](4, {(1) = Zeta(.5), (2) = a.b.c, (3) = limit(sin(x)/x, x = 0), (4) = q*s*t})

 

Download atomic1.mw

As it stands this hack may be useful in a pinch for demos and purely visual effect, but unless it's robustified then it won't allow you to programmatically generate atomic names which match and inter-operate computationally with those from the context-menu conversion. Identifiers (names) with similar typeset appearance still have to match exactly if they are to be properly compared, added, subtracted with each other.

Extra points for commenting that the round-brackets (eg. in function-application) are displayed as black while the rest is in blue by default, if you have a workaround.  That also happens when using the usual context-menu driven convert-to-atomic-identifier of the Standard GUI.

Extra points for noticing that function names like `sin` are italicized and not in an upright font, if you have a workaround. How to discern which instances of fontstyle="normal" should be removed?

Points off for commenting that this whole hack doesn't provide anything new or extra for getting around automatic simplification.  :)

This is a one-liner hack. But maybe together we could turn it into something that closely matched what the context-menu generates.

In a related question to this answer (http://www.mapleprimes.com/questions/129140-Surface-Fitting#comment129195). How can we take partial derivatives of the multivariable fitting function (in the example above, the function B(a,b)?
It seems like the package CurveFitting only allows to numerically evaluate the fitted function when we use ArrayInterpolation, but I assume deep in the code there must be an analytic ...

I try to write sqrt(4) so that it will not be calculated to 2. I typed uneval(sqrt(4)) and received sqrt('4'). I do not want quotes surrounded number 4. How can I suppress it? Is there another way to write sqrt(4) without calculation to 2?

Dear experts,

 I want to extract the coefficient of z^k from an infinite series summation (known as probability generating function or characteristic function or Z-transformation) , the co-efficient is actually the probability of the R.V. will take value k.

Next problem in the same question is the summation is not working if I sum from 0 to infinity. It is working from 0 to 300.

I have attached the PDF for expressing the problem and the Maple code. I have used convert...

I have written a (rather extensive) module, which I can load without problems if I run it in the following way:

 

restart: libname:="C:\\PathToLib",libname; with(NameOfLib);

 

Note that the above is all in one line and executed at once. If, however, I load the library like above, but line by line, the loading fails, giving the error "Error, Did not recognize this structure's syntax".

How can there be a difference...

I just purchased Maple16 and am working on a problem where I need to solve for variables which are imbedded in non-trivial equations. When I first began using Maple16 to solve for these symolic variables, the solve function worked; however, after about 45 min of using the solve command, on non-trivial equations, it would output nothing and the cursor would move down to the next line. A simple equation such as: f(x)^2-g(x)f(x)=s(x) it will still solve. Has anyone ever experienced...

hi

i have problem to find the x with Romberg's method and ask for your help...

how to find x when the integral is equal to 3

thanks for your helps

Hi all,

I have to create a Matrix of Matrix 

I have the following

Fm:= 0.01, Rs:=0.0031

W:=Fm/Rs

WM:=(2,2,W,shape=diagonal)

Now I want a matrix which has WM as a Matrix in it diagonally.

is there any command I can use.

The result needs to be like            [WM   0    0]

         ...

I am working over F_p, where p is prime. When p = 2, the number of 2x2x2 arrays (aka hypermatrices or tensors) over this field is 2^(2*2*2) = 256. Of those 256 arrays, I only want the symmetric ones: that is, if x_{ijk} is the ijk-th element of the array X, then x_{ijk} = x_{ikj} = x_{jik} = x_{jki} = x_{kij} = x_{kji}. Is there a quick loop that does this? 

 

Hi, I would like to solve for i and c in this system. But whenever I try to solve it, it give a warning message "the solution may have been lost"

eq:={rho*(psi*i+psi*epsilon*c)*(1-i-phi*((`ϑ`+mu)*(mu+delta)*(1-i-c)-beta*c*(`ϑ`+mu)-xi*i*(mu+delta))/((`ϑ`+mu)*(mu+delta)*(phi+omega+`ε`*psi*i+`ε`*epsilon*psi*c+mu))-c-(tau*`ϑ`*xi*i+beta*c*`ϑ`+beta*c*mu)/((`ϑ`+mu...

Hey everybody,

 

I'm tring to display text plots with lines and points. When I use the display command and change the size of the display, the font size does not change with it. Is there any way to have the plotted text to change size with the display?

 

Thanks,

-Patrick


I am trying to overload the "." operator (noncommutative product) to handle objects I have implemented as records. Each record contains a matrix R and a parameter l. A.B will produce a new record where l is l_A+l_B and R is R_A.R_B, "." here being the normal matrix product (and I use LinearAlgebra:-Multiply in the body of my procedure for this). The objects A and B are of type 'Element', which I have defined (using AddType) and which works.

I implemented the procedure...

oddratioeval-_maplep.mw

Hi all,

I need your kind suggestion to solve the equation for odd ratio.  I am attaching Maple file for the purpose.   I have to evaluate a function for odd ratio and for other values its zero.  I need help in assigning this odd and even ration to the function.  k can vary from 1...15, depending on ratio.

I shall be very thankful for your kind responses.

what is the window use for maple 16: vista, xp, or win 7?

First 1565 1566 1567 1568 1569 1570 1571 Last Page 1567 of 2224