erik10

I have a degree in Mathematics and Physics from the Danish University Aarhus, comparable to a masters degree with thesis - majoring in Mathematics. In 1991-92 I was a visting scholar at UCLA, Los Angeles, following graduate courses in Applied Mathematics. Since 1992 I have been a teacher in a high school (gymnasium) in Denmark. Special interests: Applied mathematics, graphics and popularizing Mathematics.

MaplePrimes Activity


These are replies submitted by erik10

@Alejandro Jakubi I agreee with you. Firstly one need to realize of course that whatever Maplesoft provide of documentation it will never be possible to fully grasp and fully master all the functionality of such a big program. When that's said, Maplesoft should try to make the program as easy as possible to use for both advanced users as well as people who are new to it. Many of the list commands are what I will regard as being on an intermediate or advanced level. You will probably not be able to mix all those clever tricks in one line to accomplish what you want, if you are new to Maple. Then you will be looking for simpler commands. It's here I am missing some commands in the ListTools package.

It would be great if Maplesoft would make some pages in the documentation, where they are focusing on some important key issues. I remember for at long time being confused on the differences between rtables, arrays, lists, vectors, sets, ... A focus on the differences would be great. As you mention: The evaluation contexts. There are a whole Zoo of those commands evalf, eval, evalb, evalhf, evalc, ... What is the overall idea of those commands and the context in which they are being used. In the Help menu under Table of Contents tab, I found a folder names "Tasks > Lists", but it had little content. The same with "Tasks < Evaluating.

When I get stuck in the Help menu trying to figure out something, I quite often write the command and a few other words in Google to seach for it on the Web. Often I end up in Mapleprimes or in the Online help menu for Maple, which is great. But I am missing pages, where Maple are handling key issues or handling similar commands 'under one hat'. I think many beginners in Maple are looking for the logic behind the concepts. When that is understood, much is accomplished. 

Alejandro, great with the list in Maple 401, as you mention: Commands and more you should know as an advanced user.

Erik   

 

Thanks a lot Markiyan! Actually I succeded myself doing it too in another way. I am proud of myself now ... finally, hehe. Here it is:

 

Here is the worksheet: Grouped_data_in_Hist.mw

Erik

Thanks a lot Markiyan! Actually I succeded myself doing it too in another way. I am proud of myself now ... finally, hehe. Here it is:

 

Here is the worksheet: Grouped_data_in_Hist.mw

Erik

@Alejandro Jakubi Right. It could be a suggestion to implement 'not in' to make it easier and making it more idiomatic. I think I remember that I got confused by the fact that say '2 in A' is not a boolean value but just an expression. One need to put it inside an evalb or is command to decide the boolean value of this expression. Then I thought it would give no meaning to put a parenthesis around and negate ... anyway I need to learn the syntax and overall logic better. Anyway more ways to do the same will definitely help the user ...

I actually use the Help menu a lot and find it quite usable. Usually I run down to the examples to figure things out. Then if I need more, I go to the description higher on the page. The 'Sets and List' page is however inadequate in my view - for such an important technique of handling lists. There are some useful eamples for sure, but also some perculiar examples, which you will never use. Many important and often used examples are not presented. The many different commands from several areas makes it difficult to get to grips with.

I think all the new possibilities with special signs `, ', op, $, ~, etc. are great, because it makes it possible to write something very compact. Sometimes you can write something in one line, which would take maybe 10 lines with ordinary programming technique. Especially the `if`operator is great. One can branch out in several possibilities without having to write an ordinary if sentence. But when something is very compact it is also harder to grasp in the beginning. That's why I request a few more basic commands in the ListTools package, besides a better documentation for lists!

Erik 

Thanks for the new ways to do the same. However I was actually placing this as a Post rather than a Question, since I hoped for a discussion about new commands in the ListTools package and a discussion if the ways to manipulate lists are sufficiently well-documented for new users in the Help menu. Since I get no response on these issues, I guess you think it is fine already.

I regard the handling of lists - as well as vectors and tables - a key issue to really get into Maple and how it works.

Erik

@Kitonum Other nice ways! No. 3: So 'not' should be in front of x[1]. Thanks!

It is nice, that these problems can be handled in many ways. Like mine, they require the user to be able to handle and mix several commands: The  `if`command, the x->f(x) way of writing a function definition and the is-command. What I am really requesting are more commands in the ListTools package dealing with the basic manipulations of lists. Ex: A new command to solve problem 1. could be named 'Except(A,B)'. That would help the users, who are not familiar with all the fancy details.

Another thing: I am missing an overview page for manipulating lists - for plots Maple has a 'Maple Plotting Guide', which is great, just to mention. In the help menu som functionality is presented (Sets and lists), but nothing mentioned about the ListTools package. When no examples on the 'Sets and Lists' page is fitting your problem, it is easy to get stuck. The user has to find the needed functionality and commands from different pages and mix them. Hard to handle, when you are new! 

Erik

Thanks for your suggestions, Carl. I did use your:

boxVector:= Vector(Size, fill= [], datatype= list(integer)):

and it works. The fun thing is that if I commented it out, it also worked. It didn't a while ago, before I made some changes in the code. Sometimes it works without any feedback from Maple, sometimes I get a blue comment from Maple, which I think is trying to tell me that I should declare a variable, even though my code was executed correctly. Then sometimes I receive a red response from Maple, in which case my code fails to be executed. I tried commenting out some of my other declarations just to see. Some of them resulted in a failure, some of them not. I am really confused, I have to say. I don't see any logic at all, but obviously you guys do ;)

Erik 

 

Thanks for your suggestions, Carl. I did use your:

boxVector:= Vector(Size, fill= [], datatype= list(integer)):

and it works. The fun thing is that if I commented it out, it also worked. It didn't a while ago, before I made some changes in the code. Sometimes it works without any feedback from Maple, sometimes I get a blue comment from Maple, which I think is trying to tell me that I should declare a variable, even though my code was executed correctly. Then sometimes I receive a red response from Maple, in which case my code fails to be executed. I tried commenting out some of my other declarations just to see. Some of them resulted in a failure, some of them not. I am really confused, I have to say. I don't see any logic at all, but obviously you guys do ;)

Erik 

 

Still another way to do it. I think I must have overlooked something myself ;)

Great to see in how many ways it can be done.

Erik

Still another way to do it. I think I must have overlooked something myself ;)

Great to see in how many ways it can be done.

Erik

Absolutely great! Thanks to both of you. I like all the different solutions and I have saved them for the future use too.

Erik

@Carl Love Thanks a lot! I have made the changes you advice me to. And in fact it works now! I had to also replace the sum command with an add command, because I received an error. The Help menu for that command say that the index i used in that command is local to the command. With the sum command it interfered with something outside ... Execution time for n = 40, k = 6 is 55 seconds on my machine.

A_recursive_procedur.mw

 

I downloaded your own code for the more efficient way, but reexecuting it created an error message. It is supposed to be easy to resolve - an unexpected ) - but I could not find any parenthesis problem, although I went through the code pretty thoroughly. It is absolutely great that Maplesoft has introduced code coloring in version 17. I hope the next thing will be coloring the line, in which the error occurs. It will often save a lot of time in debugging! Maybe you can quickly point out the problem?

Another thing: Carl, could you explain in words what the overall idea with this Module approach is? What is the benefits of using a Module and how do the Maple compiler handle the code. Only overall.

Erik

@Carl Love Thanks a lot! I have made the changes you advice me to. And in fact it works now! I had to also replace the sum command with an add command, because I received an error. The Help menu for that command say that the index i used in that command is local to the command. With the sum command it interfered with something outside ... Execution time for n = 40, k = 6 is 55 seconds on my machine.

A_recursive_procedur.mw

 

I downloaded your own code for the more efficient way, but reexecuting it created an error message. It is supposed to be easy to resolve - an unexpected ) - but I could not find any parenthesis problem, although I went through the code pretty thoroughly. It is absolutely great that Maplesoft has introduced code coloring in version 17. I hope the next thing will be coloring the line, in which the error occurs. It will often save a lot of time in debugging! Maybe you can quickly point out the problem?

Another thing: Carl, could you explain in words what the overall idea with this Module approach is? What is the benefits of using a Module and how do the Maple compiler handle the code. Only overall.

Erik

Carl, I think I need to reveal what my "do something here" is all about. I guess you will need that information to optimize your code. I did write these details into my initial simple code, because I want to see the difference in execution time between your code compared and mine. Without it we will not know how efficient it is!

Unfortunately I still have some troubles writing my own code, because I am still new to programming in Maple. I get an error message. I am unsure what to declare before the procedure. Also I am unsure if I should use global variables? After execution of the procedure, I want two large Vectors 'probVector' and 'lambdaVector' to be available outside this procedure. Maybe I should initially call the procedure with those two large vectors with zeroes? And then forget about the global variable?

Another thing: I am using Vectors here, but could also use lists maybe? What is the most efficient?

I would be very delighted if you would please tell me the minor changes which will make my own code work. Then we will know about execution times for my code, and then compare how much faster your code will execute!

I appreciate your help!

Here is my new code: A_recursive_procedur.mw

 

Erik 

 

Carl, I think I need to reveal what my "do something here" is all about. I guess you will need that information to optimize your code. I did write these details into my initial simple code, because I want to see the difference in execution time between your code compared and mine. Without it we will not know how efficient it is!

Unfortunately I still have some troubles writing my own code, because I am still new to programming in Maple. I get an error message. I am unsure what to declare before the procedure. Also I am unsure if I should use global variables? After execution of the procedure, I want two large Vectors 'probVector' and 'lambdaVector' to be available outside this procedure. Maybe I should initially call the procedure with those two large vectors with zeroes? And then forget about the global variable?

Another thing: I am using Vectors here, but could also use lists maybe? What is the most efficient?

I would be very delighted if you would please tell me the minor changes which will make my own code work. Then we will know about execution times for my code, and then compare how much faster your code will execute!

I appreciate your help!

Here is my new code: A_recursive_procedur.mw

 

Erik 

 

First 6 7 8 9 10 11 12 Last Page 8 of 17