DSkoog

Daniel Skoog

1055 Reputation

15 Badges

6 years, 22 days
Maplesoft
Maple Product Manager

Social Networks and Content at Maplesoft.com

Maple Application Center
Daniel Skoog is a Product Manager for Maplesoft. He holds a B.Sc. in Mathematics from Queen’s University, Canada and a M.Sc. in Financial Mathematics from Uppsala University, Sweden. Daniel joined Maplesoft in 2011 and has used his applied technical expertise of mathematics, statistics, data analysis and software design to deliver several exciting new releases. Daniel has also contributed several commands to the Maple library, having authored new routines in Statistics, Finance and data analysis.

MaplePrimes Activity


These are answers submitted by DSkoog

Here are some more details on connectivity for Maple and Excel: https://www.maplesoft.com/products/maple/features/ExcelConnectivity.aspx 

Maple uses the default worksheet styleset for documents unless you have specifed a custom style set in the style set dialog.

Now that said, the steps that you take to set your custom style set are correct as mentioned ( select a custom style set as your "User-defined Style Set" in the Style Sets dialogue ), however the other issue that you are seeing, namely that Maple always uses italic for math is in fact a bug. There is unfortunately no workaround for this (as you have already discovered by editing the xml). Hopefully we can get around to fixing it sometime soon.

To answer another question, the default style set that Maple uses for both its documents and help pages can be found in the %MAPLEINSTALLDIR/data/stylesets/ directory.

The try statement is used for exception handling, for example:

try
    error;
catch:
    print("Error occurred"):
end try:

If you have a network license, I believe that there are (for cost) tools available from Flexera (the maker of LMTools, Maple's license manager) for reporting on license usage. Otherwise, you can also have your system adminstrator manually go through your lmgrd logs.

If you are looking to retrieve the document meta-data, try the DocumentTools:-GetDocumentProperty command. 

If you want to get the document properties for the document you are currently in, use:

DocumentTools:-GetDocumentProperty(all)

Just in case anyone else is interested, you can set document properties in a couple of ways:

If you have a document open, you can go to File - Document Properties.

If you want to set properties programmatically, you can use the DocumentTools:-SetDocumentProperty command.

Have you tried using the Worksheet:-DisplayFile command? This open an existing Maple worksheet in a new window.

If this question pertains to clearing input and output in a command-line session of Maple without performing a restart, you could use:

In Unix:

system( clear );

In Windows:

system( cls );

If you are talking about clearing the input and output without a restart in a Maple worksheet, the only thing I believe that you can do is to select all the text in your session and then delete it.

You're just missing a colon in the P3 line. As it is, you are entering an expression 'P3 = 3/7*1000 W'. When you attempt to apply units formatting to this, it tries to format the entire expression, resulting in an error.

 

If you instead use: P3 := 3/7*1000 W, Units formatting will only attempt to format the right hand side, '3/7*1000 W'.

After testing your code and data, I can see Maple hitting a couple of snags with import and joining of TimeSeries data. For reasons that I'm not yet clear on, the import of your data from the Excel xlsx comes in as an integer value that Maple doesn't play well with. To get around this, I split your data into two separate csv files and read those in.

After doing so using ImportMatrix, I didn't have any immediate success merging the TimeSeries data, so I instead tried using a DataFrame, which is slightly more agnostic to incoming data. I usually use DataFrames whenever I have row or column labels, which in this case are the dates and column headers respectively. Storing the data in a DataFrame also makes it much easier to apply any relevant Statistics commands to the data. You might still be able to import your data using ExcelTools:-Import and other techniques, but this seemed like the quickest approach to me.

By default, the Import command uses a DataFrame for storage:

PMEAS_ROUGH := Import( "this:///PM.csv" );
QGAS_ROUGH  := Import( "this:///QG.csv" );

The Append command merges the two DataFrames, however the row labels are not sorted.

DF := Append( PMEAS_ROUGH, QGAS_ROUGH );

Reorder the DataFrame, sorting on the row labels:

DF := DF[ sort(RowLabels(DF)), ..];

Optional: Convert the resulting DataFrame to a TimeSeries:

TS := TimeSeriesAnalysis:-TimeSeries( Matrix( < < RowLabels( DF ) > | convert( DF, Matrix )> ), headers = 1 , dates = 1);

 

I've added an example worksheet (in a zipped Workbook with attached data csv files) - DataFrame_Example.zip

Hope this helps.

Hi Erik,

I've played around with this a bit and do think that you're correct in that there's a slight gap in the GUI interaction model: if someone is using the GUI interface (i.e. menus) there is no interactive way to "Import" data that is stored in a Workbook. While @tomleslie's programmatic suggestion is probably the only way to accomplish this at the moment, I agree that we could add a step to the "Data Import Assistant" that allows a user to "import" from their own Workbook or the file system (leaving aside the issue of if should still be called import if it's already stored inside of the containing document).

 

A decent parallel here is how the Workbook treats inserting images. If there is an image present in the Workbook explorer tree, then going to Insert -> Image -> From Attachment brings up a dialog that allows a user to select attachments from the Workbook tree. I'd imagine this is more in line with your expectations for the file selection dialogue box for the Data Import Assistant as well. I'll add a task for us to see about adding this for data files (and any other attachments that we can think of).

Thanks.
Daniel

It is possible to activate Maple on your new computer, but you will first need to have your activation code reset. To do so, send Maple's customer service team an email at custservice@maplesoft.com and let them know that you need to reinstall on your new computer.

Here's one way using an ifelse statement:

a := n -> ifelse( type(n,odd), 1/n, -1/n^2 );

This could also be done as a piecewise function:

a := n -> piecewise( type(n,odd), 1/n, -1/n^2 );
seq(a(i),i=1..5);

Returns:

1, -1/4, 1/3, -1/16, 1/5

You might also want to be careful at n=0, so you could also add another clause to the piecewise function:

a := n -> piecewise( n=0, 0, type(n,odd), 1/n, -1/n^2 );

 

 

You just need to use capital-M Matrix instead of 'matrix' in your code:

with(LinearAlgebra):
A := Matrix(3, 3, [-3, 2, 1, 1, -2, 1, 1, 2, -3]);
GaussianElimination(A);

The LinearAlgebra package doesn't work with the deprecated lower case 'matrix' constructor.

 

This is a bug in Maple 2016.1 for which we will be issuing a fix for later this week (the fix is being tested by our QA team as we speak). The bug itself can manifest in several ways, but is usually triggered while using Greek characters Pi, Zeta, or Gamma in 2-D math and the resulting error is the same in each case. For the time being, we will be turning off the auto-update to 2016.1 and re-enabling it for 2016.1.1 when it is available. Until the update is available, we would recommend either reverting to Maple 2016.0 or using 1-D Math.

A similar issue was reported here: www.mapleprimes.com/questions/211532-Bugs-In-Parsing and is due to the same underlying issue.

In your while statement, add 'Do' around each of the components that you want to query:

while Do(%x) >= Do(%y) do

This should fix the error that you're seeing. I personally find the 'Do' command to be somewhat ambiguous, so you might also try the GetProperty and SetProperty commands to get and set the value in the text area respectively.

Using 'GetProperty' for your do while loop:

while GetProperty(x,value) >= GetProperty(y,value) do

 

1 2 3 4 5 6 7 Page 1 of 8