ImplicitFunctionGrapher & attempts to optimize

ImplicitFunctionGrapher & attempts to optimize - Messages

#1 Posted: 5/11/2010 2:07:45 AM
dg1727

dg1727

0 likes in 18 posts.

Group: User

Hello,

In trying to graph an implicit function f(x,y)=K (where K is a constant) that was difficult or impossible to separate into a 1-variable function y=F(x), I came across this webpage with a Mathcad example algorithm (thanks to Mr. Ochkov for publishing this example).

I adapted the algorithm for SMath Studio, producing this .sm example.



1. Is this example appropriate for the Examples page of the wiki? If so, is there anything I should change before posting?



2. I tried to implement Mr. Ochkov's suggestion, in footnote 9 at the very end of his webpage, for speeding up the algorithm by caching previous computed values of f(x,y) instead of computing them over again. But the algorithm got slower instead. I made a .doc file and a .sm file showing this.

I tried SMath Studio's eval() function (not shown in the files, but mentioned in the .doc file) as suggested at the bottom of this wiki page. It did not help.

Is there anything simple I can do to speed up the algorithm? Any suggested solution should not depend on what kind of function f(x,y) is. The function that appears in my example files is of a different kind than the function that I originally needed to plot (at my workplace).

Maybe future optimizations in SMath Studio could be made to help with cases like this. It is not (yet ) important to me, though.

Thanks in advance for any comment.
#2 Posted: 5/11/2010 6:19:23 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello,

Feel free to put your examples on the Wiki. There are no restrictions. Make them however you like. You are free to put also your comments and anything you feel that would be useful for other users.
Moreover, you can upload files there as well.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 5/11/2010 1:24:38 PM
dg1727

dg1727

0 likes in 18 posts.

Group: User

I have updated the example slightly:

ImplicitFunctionGrapher_slow.sm (ZIPped)
ImplicitFunctionGrapher_1.pdf

Please use the updated versions, rather than the versions in my first posting, if possible. Thanks.
#4 Posted: 5/11/2010 2:42:14 PM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

Thank you, dg1727!

I've changed optimization method of the main loop of the file to Numeric (it helps to save about 40% of calculation time - 1 min. 46 sec. on my notebook now) and have uploaded your files to SMath server:

ImplicitFunctionGrapher.sm
ImplicitFunctionGrapher.pdf



Additional examples were tested:

[math]x^2*y^3-7*x^3*y^3-7[/math]


[math](x^2+y^2)^2-7*(x^2-y^2)[/math]


Regards.
#5 Posted: 5/11/2010 10:26:38 PM
dg1727

dg1727

0 likes in 18 posts.

Group: User

Thank you for the tip on setting Optimization to Numeric.

I have added a description of this procedure to the Programming page of the wiki. My apologies if I stated anything incorrectly.

I have also updated the files on the Examples page to include the Numeric optimization. (I made some minor edits as compared with the version in Andrey's post above. I wanted to make sure the .pdf matched the .zip.)
#6 Posted: 5/12/2010 7:20:29 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Well done dg1727

Thank you.

Fell free to add to the Wiki anything you might find useful for other users.

Regards,
Radovan

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
  • New Posts New Posts
  • No New Posts No New Posts