957 Reputation

10 Badges

14 years, 252 days
University of Kent

Social Networks and Content at Maplesoft.com

MaplePrimes Activity

These are replies submitted by casperyc

@acer @Alejandro Jakubi

I haven't used Maple IDE but had heard about it several times.

Just to say that I hope it will be FREE or built into Maple in future release.

Currently, I am writing all my code in notepad++ and use file extension .c, so I can have "reasonable" syntax highlight.

Then open up a .mw file in Maple GUI, read the code in, and test it.


It has been working well for me to manage my whole PhD research.

Such as IDE would really hopeful.


To answer your question, yes, I was only "having fun" (testing) with your ticker2 file. Or if you like, I am stressing testing it. One of the calls returned a "P".



And to get back to my initial motivation, here is a "bigger" toy example,


you can think the function "f" as a likelihood function, which needs optimization.

In the big procedure, I was doing the optimization, and returns some useful information.

When I have a "complicated" function, it takes a long time to run the optimization. So I want to see if it's possible to track the values.


In the "f" procedure, if you uncomment #print(ans);

It will take a looooog time to display (print) the values. That's why the plot option is a better solution.


Difficulties are:

1 - we dont know when (and how) the "f" function is called.

2 - Yes, I am planning on calling it many times (in the same worksheet). Would that run into some danger from your code at the moment?


I will also pm you a copy of the full code for your insterest.








@acer I will take a detailed look.

Just to note, you also commented in the sheet that the second p(1000) will produce errors. I didnt get any after I run it. It's just that if I run it (the same procedure) many times, say




I end up with a symbol "P". and just by a quick look, I am not sure why this is the case.

Does that mean it cant be repeated??


@Carl Love See this, it's in the left bottom corner.


@Carl Love Yes, I would in general use 'print' if i am debugging, or trying to see if the procedure if running or not.

But in this case, I want a graph to track something that's moving for a long time.

In this case, acer's solution is working just fine. I tried yours, it has repeated plots, which does not update.





@acer That's exacly what I am looking for.


Is that possible to "add on" points, rather than plotting the whole "A" every time it's refreshed?

I am just thinking about reducing the memory usage. If I run a task with 30,000 intermiadite values, which I dont need to keep. It would also take "some" space in the RAM and just become wasted. I have also changed "A" to "local".


Can I put the component as an output from the procedure? That is, just like a result (it does not need to be save to any variable) while running the procedure, until it's finished. I don't like it fixed at a position.

Hopefully, after I run "mytest", the plot pops up, and shows me the same real time plot, and the final result.




@Markiyan Hirnyk Hi Hirnyk,

Sorry that I had only seen this now.

Yes, with the given example. It is for sure it has to optimal points.

As for this quesetion in general, I am trying to simply the target function, so I think it is a good point to stop the discussion now. If I have more question, I will start a new post and try to be more precise.


Many thanks,



@Markiyan Hirnyk Why do you think I reproach you? If in any way you feel that, I am really sorry.

I do appreciate people helping others on the forum. I am aware that people are busy. I am busy as well as a PhD student.


I did excute your file, but there was nothing (for me) to comment on.

I didn't see the result I am hoping to get, even after you made your changes in the file.

The optimization did run, but it did not give me the desired values, see the OP.

And I have pointed out, with(DirectSearch), I dont need to change anything. The problem is just that it does not reach the optimal values.


Regard to your last commment, I believe I did reply. (Edited: SORRY, I just noticed that I did NOT reply to the lastest comment.)



@Markiyan Hirnyk 

As we can see, that after the changes, we are still unable to get the values.

Could you explain why the changes?


with DirectSearch, I dont need to make the changes and it still does not work, see the new sheet attached.


It uses a lot of times and does not return anything (wndows X64, Maple 18). I tried the school sever (linux X64, Maple 17), it stops and says that something about "GC stack limit reached" (garbage  collecting thing?).


So no way to approach this staright away?




@Carl Love That's nice.

But is there a way to keep data as it is (a list). And pass the argument "data", to printf?

The reason is that if I use the above way and change it to evaln, I have to modify every single place in my codes.

For now, i just created a new local variable and assigned it as newvar:=eval(data) to accomodate it the "old data" variable.




@Kitonum Perfect, thanks!

@Carl Love I don't know much about ODEs, and was just browsing Maple primes.

I am a bit confused why (how) would you  think of reducing the accuracy?

And what does the Reduced accuracy answer tell us?


In my experience, sometimes when I got underflow (tooo small) issue, I would increase accuracy, to get something out of it.


Is it a useful thing to explore?

@Alejandro Jakubi

here is what happens

Test file: go.mpl









Windows 7 SP1 X64

In command line (cmd), if I do

cmaple -q go.mpl > results.txt


It has contents, as expected.


When using

start cmaple -q go.mpl > results.txt

It is BLANK.


Again, as I mentioned above, I want to start several maple servers simultaneously to "maximize" the power of my CPU, I found that is the way, i.e. go with "start".

If I only use


cmaple 1.mpl

cmaple 2.mpl

cmaple 3.mpl

in a script (.bat) file, it goes with a single mserver.



@Alejandro Jakubi I am sure that the "true" comes from cmaple (in windows).

The optional parameter -q will produce it. See the picture above.

But anyway, it will not affect a lot. I will just leave it as it is.

My .mpl files has writeto commands and will write my desired results. So I dont need to use ">" to another file.

However, I did test it say the test.mpl file has



when I run the file like

maple test.mpl > result.txt

The file is BLANK.

I assume this is corrent? The result.txt would only record "formated" output, like printf?


@Alejandro Jakubi Yes, I know batch file pretty well.

But just to clarify, what you suggested in linux,

maple a.mpl &
maple b.mpl &
maple c.mpl &

works for me and is what I am expectinig. Without the "&", it still works one by one. (Maybe I am writing it wrong??)


However, in windows

cmaple a.mpl
cmaple b.mpl
cmaple c.mpl

will work BUT it not what I expect. It's excutes one by one.

what works for me is

@echo off

start cmaple.exe a.mpl
start cmaple.exe b.mpl
start cmaple.exe c.mpl

That works simultaneously.


Just to "improve" a bit more, in windows, the above .bat file show the three cmaple window, is there a option to run silently at background?


I now use this

@echo off

start cmaple.exe -q  a.mpl
start cmaple.exe -q  b.mpl
start cmaple.exe -q  c.mpl



to aviod the messages. Is there a way to get ride of the "true" as well?


1 2 3 4 5 6 7 Last Page 3 of 22