MortenZdk

60 Reputation

4 Badges

8 years, 289 days

MaplePrimes Activity


These are replies submitted by MortenZdk

@Thomas Richard Found out that the save statement could be used to save specific functions in .mpl file, which may be OK for my need, so to save f and g I could do save(f, g, cat(interface(worksheetdir), "/module_4_multi.mpl"));

Found out that a .mpl file can be read from directory of current .mw file using:

    read(cat(interface(worksheetdir), "/module_3_test.mpl")):

The .mpl file can when be generated using GUI File -> Export As... from another .mw file.

 

@Thomas Richard Thanks, but unless it makes usable .mpl file, I think I must use GUI for now.

My intention was to develop functions in .mpl files using .mw format for easier writing and tryout, and then use the resulting .mpl file to make the functions available as a "package" in to other files.  Reason for not using the regular package system, is that I want to base this on local files only.

@tomleslie Thanks for your update.

The use of menu Format->Numeric Formatting window, and then hitting the "Apply and set as default" also make the format apply to all the subsequent calculations in my system.  However, to apply this to all calculations in a worksheet, I have to select all (Ctrl-A) and then apply the format using the GUI menu. 

Is there any way to give this formatting control through a statement, so I can change the presentation through out the worksheet, similar to interface(displayprecision=4) ?

It appears to me that the mix of using a GUI menu Format->Numeric Formatting, that apply attributes to the worksheet lines, is the wrong approach in worksheet mode, where a statement similar to interface(displayprecision=4) should be used instead.

With respect to Digits, then I don't want to limit the internal calculation precision; the purpose is only to present results with a precision that matches the input data precision.

 

@Carl Love and other:  I can now see that it is my fault, and that I did not read the documentation on Digits carefully enough.  Also in the Maple Quick Start Tutorial video https://www.youtube.com/watch?v=4jFi7CmxXAk at 02:00 I misunderstood what Digits did, based on a quick assumption about the shown result. 

@Carl Love Thanks for this reply. 

 

It is amazing that the Digit statement is promoted in Maple documentation as it is, since it simply result in incorrect calculation, when then purpose is just to have a specific representation.

I actually used the Digit statement for quite some while, wondering why my calculation were slightly off, until I realized what I asked Maple to do.

@tomleslie Thanks, that does it somehow...

But the formatting must then be applied to the each line.

Do you know if there is someinitial statement that can be used, e.g. like "interface(displayprecision=2)" ?

Do you know if there is a way to get the precision given by a number of digits, e.g. 4, thus giving 3.333, or 33.33 and 333.3 ?  Thus not controlling only the number of digits after the decimal point, since for exponent notation the total number of digits are relevant for the precision.  HP calculaters does this correctly when using engineering format.

 

Btw. when I apply the engineering formatting through the Format menu, the interface(display_zero_complex_part=false)" stops to work!  Looks like a bug.

 

@Mac Dude Thanks you very much for the elaborate description, and will try that based on the description in the Maple Programming Guide.

It is pretty weird that doing simple package reuse between worksheets is that complicated, and I wonder if I try to do something wrong.  I would suppose that procedure sharing between different applications (worksheets) should be a straight forward feature of a programming system, and that sharing should be possible to resolve locally, to avoid name collision.

@Mac Dude I tested read("./<filename>"), but it read from the main Maple program directory, not the directory with the worksheet.  I could neither find any kernelopts variables with information about the current worksheet directory.

I wonder, now does people share a number of worksheets with a common package ?

 

I assume there must be some smart way to do that, so a team of people can develop and use the same set of file, just like other kind of programming.

@Mac Dude Thanks for your reply.

Is it possible to save the file locally, and then read it like read("./local.mpl") ?

Is it possible to read or include a .mw worksheet file directly, so I do not have to export to .mpl text file each time I have made modifications ?

The "use" does not look right; ain't it "with" that should be called ?

 

@Carl Love Thanks, that was very helpful.

Is there a way to show the polar representation using degrees instead of radians ?

@Joe Riel Thanks for information about "(*" and "*)", and that explains why I could not find "(**)" in any documents ;-)

@Joe Riel Thanks, learned some new functions.

What does "(**)" do ?  I could not find this in either manuals.

@acer Thanks for the examples; it helps with the understanding and the possibilities.

Appears that the outer "eval" can be omitted in the last example, so it simply is:

seq(subs(a=aa, eval(f)), aa=1..3);

 

@acer Thanks for the elaborate answer; sounds like I must do some studying of the Programming Manual to learn the Maple evaluation model.

1 2 3 Page 1 of 3