Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


27 Pages«<45678>»
Options
Go to last post Go to first unread
Offline uni  
#101 Posted : 16 May 2013 01:43:33(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Quote:
Open issues:
- handling of undefined values

Updated. Try again.

Quote:

- re-calculation upon mouse release. Currently, even leaving the region will not trigger update of the plot.

I can't do that. Class describing the region doesn't contain the event - leaving the region (OnLeaving). So I can't to know about this event. Besides, I doubt that a user wants such a reaction with long calculations.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 16/05/2013(UTC)
Offline kilele  
#102 Posted : 16 May 2013 02:02:50(UTC)
kilele


Rank: Advanced Member

Groups: Registered
Joined: 30/03/2011(UTC)
Posts: 393

Was thanked: 132 time(s) in 113 post(s)
working nice on vista/0_96_4883.Mono/XYPlotRegion_20130516r1,
though I can't test Martin's open issues because I don't understand what you guys are talking about Good

suggestions: zoom around the mouse pointer ; button to 'reset view'

Edited by user 16 May 2013 02:04:25(UTC)  | Reason: Not specified

Offline mkraska  
#103 Posted : 16 May 2013 02:26:30(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: uni Go to Quoted Post
Quote:
Open issues:
- handling of undefined values

Updated. Try again.


Thanks for the update. Plotting ln(x) now works. Still I keep annoying. Division by zero causes trouble. I frequently use this as a handy trick to limit curves to certain ranges.

mkraska attached the following image(s):
xy3.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline uni  
#104 Posted : 16 May 2013 03:59:12(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Quote:
Tested in 4883 (with annoying error messages at each interaction and no way to access the context menu of the plot)

Show how it looks. I don't have any problems (xp, 0.96 build 4883, x-y plot 0.1.4884.13578).

Updated.

Edited by user 16 May 2013 04:35:05(UTC)  | Reason: Not specified

uni attached the following image(s):
XYPlotRegion_screen12.png
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 16/05/2013(UTC),  on 16/05/2013(UTC)
Offline mkraska  
#105 Posted : 16 May 2013 08:03:52(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: uni Go to Quoted Post

Show how it looks. I don't have any problems (xp, 0.96 build 4883, x-y plot 0.1.4884.13578).

Updated.


Thanks for the update, problem solved. Even context menu under 4883 is now accessible (I expected this to be an issue of the main prog, still typing to the placeholder gives errors, just like typing to the canvas or other regions.)
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline omorr  
#106 Posted : 16 May 2013 10:28:12(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Just to confirm this,

Resizing with the mouse (zooming, moving) will affect X and first Y(left) axis. The second Y2(right) will be static. I suppose this is by design and that simultaneous interactions with X and both Y axis could introduce unnecessary complications.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline mkraska  
#107 Posted : 16 May 2013 18:15:38(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
SMath crashes, when you try to access the context menu of the plot in SMath 4883 and 4884. It's not exactly a crash, but rather an error message, giving you the option to continue (without chance to access the context menu) or to stop the program.

Removal and inserting a new region solves the problem. The file is from the maplewrapper examples.

Edited by user 16 May 2013 18:18:24(UTC)  | Reason: Not specified

File Attachment(s):
Trigonometric functions.sm (14kb) downloaded 75 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline oscampo  
#108 Posted : 16 May 2013 19:36:41(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Originally Posted by: mkraska Go to Quoted Post
SMath crashes, when you try to access the context menu of the plot in SMath 4883 and 4884. It's not exactly a crash, but rather an error message, giving you the option to continue (without chance to access the context menu) or to stop the program.

Removal and inserting a new region solves the problem. The file is from the maplewrapper examples.


I just downloaded the 4884 version and this example works fine for me. Apparently there is a new "version" in the download link.

Oscar
Offline uni  
#109 Posted : 16 May 2013 19:55:46(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: mkraska Go to Quoted Post
SMath crashes, when you try to access the context menu of the plot in SMath 4883 and 4884. It's not exactly a crash, but rather an error message, giving you the option to continue (without chance to access the context menu) or to stop the program.

Removal and inserting a new region solves the problem. The file is from the maplewrapper examples.

I confirm this and I haven't any idea why this happening. It's really strange behavior. But doubleclick works fine.

Good If you change showInputData value in attached file ( showInputData="true" ) then error will disappear.
Russia ☭ forever
Viacheslav N. Mezentsev
Offline kilele  
#110 Posted : 17 May 2013 17:30:38(UTC)
kilele


Rank: Advanced Member

Groups: Registered
Joined: 30/03/2011(UTC)
Posts: 393

Was thanked: 132 time(s) in 113 post(s)
uni, please add this article to your bookmarks, you may find something useful for your plugin.
http://www.codeproject.c...brary-for-graph-plotting
thanks 1 user thanked kilele for this useful post.
on 17/05/2013(UTC)
Offline uni  
#111 Posted : 17 May 2013 17:41:52(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: kilele Go to Quoted Post
uni, please add this article to your bookmarks, you may find something useful for your plugin.
http://www.codeproject.c...brary-for-graph-plotting

Ok. I've seen this project before.
Russia ☭ forever
Viacheslav N. Mezentsev
Offline mkraska  
#112 Posted : 20 May 2013 13:57:55(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
There is a problem with the x-y plot of functions involving eval(). Error message says "x undefined".

Edited by user 20 May 2013 13:59:40(UTC)  | Reason: Not specified

File Attachment(s):
evalxy.sm (11kb) downloaded 59 time(s).
mkraska attached the following image(s):
evalxy.png
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline omorr  
#113 Posted : 20 May 2013 18:39:55(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello Martin,

I suppose this has to do with the fact that the SMath and XY plots have different treatment on the variable named "x". Therefore, I suppose that the source of different treatment of eval() is connected to different "x" behavior (I might be wrong regarding this). XY plot treats the expression more similarly to Mathcad. Like in your last plot with the variable "h". It just represents the plot of y=x because variable h is note defined before (regardless to function h(x)) (like QuickGraph in Mathcad).

For instance, if we use x:=1 and then define f(x):=x^3, SMath plot will give a cubic function y=x^3 but XY plot will give y=1.

Uni could give us more precise explanation about this.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline uni  
#114 Posted : 20 May 2013 19:19:04(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
I'm trying to support different types of expressions and have not found easy way to get the results. Support for one type affects expression of other types. It will take time to carefully separate all the possible types of expressions. Now I use the shortest and fastest way, but it has limitations.

Is there really a need to use the function eval()? What is it for? I think that using an analogue of this function in the plugin.

Quote:
I suppose this has to do with the fact that the SMath and XY plots have different treatment on the variable named "x".

Yes, it is. I use the more general case. I don't want bind to the variable name. I can't substitute the value of the variable x, so eval() doesn't work. In the original, first there is a substitution, then the calculation (I use the pre-transformations to determine the type of expression, eval() function prevents this). I'll think maybe it can somehow be workaround.

Edited by user 20 May 2013 19:49:34(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline mkraska  
#115 Posted : 20 May 2013 21:18:52(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: uni Go to Quoted Post
Is there really a need to use the function eval()? What is it for? I think that using an analogue of this function in the plugin.


There were multiple occasions in the past, where users got the recommendation to speed up the performance of their calculations by use of eval(). I tried this when preparing this post. Who has ever tried to change the axes scaling by some orders of magnitude in the built in 2D graphics, knows how it feels with a slow function and the plot re-calculated after every mouse-wheel increment.

In the case of the xyplot plugin, this is relieved because recalculation does not happen unless you enforce it. And coming back to your question: I do not dare to answer what exactly the eval() function is for. Just guesses that may be wrong in some details.

I would not mind the independent variable names be limited to x and y or r and φ if that simplifies the rest of expression treatment. If you do not want x and y to show up in the expression, you are free to bind other names to that variables in advance.

SMath should provide as few as possible pitfalls and inconsistencies as possible. That is sort of driven by handbook-writing. The more consistent the program's behaviour is, the less you have to explain.

uni, are you re-engineering expression evaluation because you are unhappy with the limitations of the internal graphics functions (in terms of function evaluations, sticking to x,y,t) or just because you do not have access to Andrey's code?

Edited by user 21 May 2013 15:01:35(UTC)  | Reason: Not specified

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 2 users thanked mkraska for this useful post.
on 20/05/2013(UTC),  on 21/05/2013(UTC)
Offline omorr  
#116 Posted : 21 May 2013 08:24:14(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
As much as eval() and numerical optimization are solving some problems in SMath, it seems that this relation symbolic-numeric-eval() is the most headache-giving at the same time.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 21/05/2013(UTC)
Offline oscampo  
#117 Posted : 21 May 2013 17:58:45(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Originally Posted by: mkraska Go to Quoted Post
There is a problem with the x-y plot of functions involving eval(). Error message says "x undefined".


As I understand eval(expression) gives a numeric result of evaluation of "expression", so, f(x)=eval((x-2m)^2) needs a previously defined value for x.

If you type "f(x)=" in SMath, you obtain the "x not defined" warning. Now, if you define a value for x, (say x=1), f(x) can be evaluated and it will give a numerical result, (f(1)=1), which is plotted as a constant in XYplot plugin.

Oscar
Offline mkraska  
#118 Posted : 21 May 2013 20:08:54(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: oscampo Go to Quoted Post
Originally Posted by: mkraska Go to Quoted Post
There is a problem with the x-y plot of functions involving eval(). Error message says "x undefined".


As I understand eval(expression) gives a numeric result of evaluation of "expression", so, f(x)=eval((x-2m)^2) needs a previously defined value for x.

If you type "f(x)=" in SMath, you obtain the "x not defined" warning. Now, if you define a value for x, (say x=1), f(x) can be evaluated and it will give a numerical result, (f(1)=1), which is plotted as a constant in XYplot plugin.

Oscar


eval() is used to strip any symbols down to numeric values if that is possible. In definitions, however, the dummy or formal parameters must not be touched by that mechanism. Otherwise using formal parameters inside eval() in function definitions would be an error that the system should warn about.

Things get more complicated if interactions with setting the whole formula region with function definition to symbolic or numeric optimization. To add more complexity, think of the implications of similar settings at evaluation (function call) time. This is where the plot functions have to survive.

Regardless of how things are and why: using some construct like eval should not render a function unplottable, just because there is no reason to expect such behaviour.

Edited by user 21 May 2013 20:32:27(UTC)  | Reason: Not specified

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Davide Carpi  
#119 Posted : 21 May 2013 21:08:57(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: mkraska Go to Quoted Post
Regardless of how things are and why: using some construct like eval should not render a function unplottable, just because there is no reason to expect such behaviour.


It's not so easy; when you call a primitive (a function or an object, like a graph) you can put in the placeholder anything...
Correctly (IMHO) from a plugin you can retrieve what you have written in the placeholder or what are "linked" by what you have written (if you define A(x):2*x and you write in the placeholder A(x), then you can retrieve both A(x) or 2*x); to obtain 2*x there are 2 ways, a "simple" preprocessing and a symbolic preprocessing... in both the cases the eval() function works like a super-function and force an "in-place" evaluation, so if there is something not defined an error appears. Probably Andrey can change this behavior when eval contains undefined variables - I hope not in other case, because I widely use eval() + preprocessing in my plugins Biggrin - but I suspect that this would be not "for free" (I think about consequences on some built-in feature and obviously on the existing homemade plugins). Obviously there is a solution for everything, it is only a matter of time, work and patience Good


best regards,

w3b5urf3r

Edited by user 21 May 2013 21:26:07(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 2 users thanked Davide Carpi for this useful post.
on 21/05/2013(UTC),  on 23/05/2013(UTC)
Offline mkraska  
#120 Posted : 21 May 2013 23:14:14(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
For now my conclusion is a new survival rule:
"Do not use eval() in functions that you want to plot with xyplotregion."

I don't know if that is a bug or a feature of function definitions in general (dummy argument namespace concept), of eval() in particular or of the plugin. Of course, the fact that the internal plot function works with eval(), is sort of a hint...


Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Users browsing this topic
Similar Topics
X-Y Plot Region Plugin (Extensions)
by ndtma 24/06/2018 06:00:49(UTC)
X-Y Plot Region Plugin Problem (Questions)
by ndtma 20/06/2018 19:38:44(UTC)
27 Pages«<45678>»
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.