nm

8769 Reputation

19 Badges

11 years, 313 days

MaplePrimes Activity


These are questions asked by nm

I could not find a way to do this in Maple looking at http://www.maplesoft.com/support/help/Maple/view.aspx?path=parameter_classes

and I see that Maple is missing from http://rosettacode.org/wiki/Named_parameters

Is it possible to call a Maple proc using named parameters? Here is an example of what this looks like from a small Ada example from the above link:

procedure Foo (Arg_1 : Integer; Arg_2 : Float := 0.0);
Foo (Arg_2 => 0.0, Arg_1 => 1);

This is very useful for proc with many arguments, and it also makes the code much
more clear and less change in using the wrong value for the wrong parameter.

In Maple notation, this can be like

foo:=proc(arg1::integer,arg2::float) ..... end proc;
foo(arg2=>10,arg1=>200);

(This editor is so bad, can't someone fix it?)

Using worksheet mode. It is a strugle to add a new paragraph on its own group so I can document some code.

I open new worksheet, and type a Maple command. say

x:=10; and hit return.

Now the screen looks like

------
|>x:=10;
|                        x:=10
----
|>     curser is here now    (1)

Now I want to make new paragraph, on its own group, before I type new command. (I need it on its own group, to fix another Maple latex export issue) i..e I want it to look like

------
|>x:=10;
|                        x:=10
----
|   this is pargraph I wanted to create
-----
|>     curser is here now    (2)

However, this is not possible using one command.  when in (1) above, if I tell Maple to insert paragraph->Before cursor, it does this:

------
|>x:=10;
|                        x:=10
----
|  it created a paragraph- here, but this is still in the same group as (1) below
|>     curser is here now    (1)

Only way I found to do it is this: create an execution group before the cursor. Then go back to that execution group. Then do insert paragraph->Before cursor, then delete the execution group just created, leaving the paragraph on its own group:

Step 1

------
|>x:=10;
|                        x:=10
----
|> create this as execution group
----
|>

Step 2

------
|>x:=10;
|                        x:=10
----
|   create paragraph here
|>
----
|>

step 3, delete the execution group, leaving the paragraph

------
|>x:=10;
|                        x:=10
----
|   leaving paragraph on its own here
----
|>

there got to be a simpler way? I am using Maple 18 on windows 7. (64 bit)

 

Maple 18, windows 7.

When I export this to Latex

x:=1/y;

The latex comes out as x:=y^-1 instead of using 1/y as it displays. I prefer 1/y and not  y^-1

i.e. instead of generating {y}^{-1} it should use \frac{1}{y}, just as it appears on the screen. Is there a configurration option one can use for this?

I also like to know if one can insert latex markup directly in Maple text paragraphs?

For example, if I add a text paragraph, (Menu->Insert->Paragraph) and would like to type some math in there, I can't just write $\sin(x)$ as this will not render as math when exported to Latex, as it is in a Maple normal group in the Latex file. 

Is there another way to typeset math in text area of a document? I only use worksheet mode. Not interested in using document mode.

thank you

 

 

   

I'd like to bind a symbol to some expression, but display the expression analytically before evaluating, and show the value on the same line (not new line).

Something like:

restart;
a:=10: b:=3:
f:='a+b^2';`=`,f;

But this display the expression and its numerical value on 2 lines. I'd like to get this output:

      f:=a+b^2 ,`=`,19  

This is just so I can see the expression before it is evaluated, and its numerical value on same line. Or if there is a better way do this. I tried using print, but could not get the assignment to work then.

 

I am not sure why Maple gives this:

r:=int( 1/(x+sqrt(x)),x);

Using Mathematica and Matlab, the answer should be

   2 Log[1 + Sqrt[x]]

At x=1, Maple result is not defined, since log(0), but Mathematica gives a numerical value for 2*log(2)

Is this a brach cut issue? Could someone please verify this. I am using Maple 17.02

The real part of both solutions agree for x>1, but Maple answer ofcourse has a complex part, and that is what I am wondering about. Is Maple correct, and Mathematica should have returned that? May be a Math expert can comment.

 

 

First 160 161 162 163 164 165 166 Page 162 of 167