[SS-3470] Derivative problem

[SS-3470] Derivative problem - Failing derivative function definition - Messages

#1 Posted: 8/16/2017 6:45:17 AM
Jan Claeys

Jan Claeys

2 likes in 25 posts.

Group: User

Dear all,

I am currently struggling with a basic function extreme problem

NOK.PNG

OK.PNG

NOK.sm (15 KiB) downloaded 44 time(s).

OK.sm (60 KiB) downloaded 51 time(s).

edit by mod: names of attachments are swapped, as mentioned below


In the first screenshot, the function derivative definition results in a warning message: "input string was not in a correct format"

In the last screenshot, I removed all parameters values that aren't related to the given formulas (not visible in the screenshot), and I get the right solution?! However, I don't see the root visually in the accompanying graph?


I thought it had something to do with the reservation of parameter "x", but this doesn't seem to be the case...


Thanks in advance for any feedback!

Kind regards from Belgium,

Jan
#2 Posted: 8/16/2017 7:32:22 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

could you please attach the worksheet?
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Posted: 8/16/2017 7:46:09 AM
Jan Claeys

Jan Claeys

2 likes in 25 posts.

Group: User

Hello Martin,

Thank you for your fast reply, I just added the files...
#4 Posted: 8/16/2017 8:41:19 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

I don't see the root visually in the accompanying graph?


==============================
The root(s) won't appear by magic ! You must instruct the plot.
Click left/right on the 2nd plot ... enable "Display input data"

Welcome to Smath Community, Jean

Maths Golden Ratio jmG.sm (21 KiB) downloaded 38 time(s).

#5 Posted: 8/16/2017 8:49:37 AM
Jan Claeys

Jan Claeys

2 likes in 25 posts.

Group: User

Hello Jean,

What I meant was that the derivative graph doesn't cross the X-axis at x=3.29, this is where the original function P_c_hor(x) reaches it's maximum.
This is odd, since the root function indicates correctly a root at x=3.29 in the file NOK.sm (I switched the names the smath files, my mistake... ).

So my question remains: why does the solve function doesn't work in both attached files?

Kind regards,

Jan
#6 Posted: 8/16/2017 9:56:42 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

So my question remains: why does the solve function doesn't work in both attached files?


======================================
Hey mon ami ! You have not attached any file .

Click on "Post reply" down the page.
You will see the icon line, click on the paper clip
"Insert an existing Attachment or upload a new file"
Browse for the file in your system, double click on the file name
You can add as many file as you wish [the limit is ~ 5 MB]

Jean


#7 Posted: 8/16/2017 9:59:23 AM
Jan Claeys

Jan Claeys

2 likes in 25 posts.

Group: User

True, I added them afterwards to my first message ;-)
FYI: I switched the names of the files, my mistake...

You'll see what I mean if you compare the files.
I used the last beta version of smath.
#8 Posted: 8/16/2017 12:18:09 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

It could probably be repaired by zapping the entire system.
Wait for Martin to check.
#9 Posted: 8/16/2017 12:20:48 PM
Jan Claeys

Jan Claeys

2 likes in 25 posts.

Group: User

Ok, what do you mean with zapping? Debugging? Re-compiling the source code?
Thanks for your feedback!
#10 Posted: 8/16/2017 1:18:46 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

... as it looks, the derivative as given is not accepted.
The mouse had problem digesting the elephant .
Done from infinitesimal analysis ... OK.

Maybe I open the wrong sheet ?

Jean

OK repaired.sm (63 KiB) downloaded 37 time(s).
#11 Posted: 8/16/2017 6:23:05 PM
Jan Claeys

Jan Claeys

2 likes in 25 posts.

Group: User

Good evening Jean,

No, you edited the right sheet ;-) (nok is ok and vice versa, I was too fast when I changed the filenames... )

Thank you for the work you put into this, I really appreciate this!
As far as I can see, the problem seems to be (amongst others?) the use of units, since you removed every unit?
I am aware that good old Mathcad (when it still belonged to Mathsoft, PTC made a mess of it...) also struggled with this.

However, it stays unclear why my approach works in sheet "nok.sm" and not in "ok.sm", while it's 100% the same in both cases?!
There seems to be something wrong underneath the smath "boot"?

I will study the sheet more in detail (and put every value into SI) tomorrow at my work, thanks again!

Kind regards,

Jan

p.s. As a BD (bande dessinée) fan, your name reminded me of this legend (aka Moebius) ;-)
https://en.wikipedia.org/wiki/Jean_Giraud
#12 Posted: 8/17/2017 2:46:41 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

However, it stays unclear why my approach works in sheet "nok.sm" and not in "ok.sm", while it's 100% the same in both cases?!
There seems to be something wrong underneath the smath "boot"?


========================================
Can't explain either. NO unit plots much smaller in magnitude and the function q(x) ends @ 3.5.
Infinitesimal analysis is a Lagrangian method that existed before "Symbolic engines".
Was effective for Excel to manage more advanced maths before Mathcad/Mathsoft... Maple.
It applies to 2nd derivative as well and integral. The 2nd derivative
starts producing noise [world is not perfect]. The Lagrangian methods extend
to point derivatives/integral ... very useful for point capture systems like
in Process Control & Instrumentation where have only values [accumulated values].

In the red, in the attached, I have isolated the Guilty ... Ah !
As it looks, with the unit system those "Guilty" may be smaller, thus less guilty.

Cheers, Jean

OK repaired.sm (144 KiB) downloaded 35 time(s).

#13 Posted: 8/22/2017 12:46:57 PM
Jan Claeys

Jan Claeys

2 likes in 25 posts.

Group: User

Hello Jean,

I made a revised version of my original document today, based on your remarks. Luckily, I managed to keep the units "on board": by doing so the document is more readable for my colleagues.
Every value is correctly evaluated now: yes!
Thank you for the hint about the infinitesimal derivative, let's hope that SMath's next version will have a flawless standard derivative function, since the actual one doesn't seem to work...

Kind regards,

Jan
#14 Posted: 8/22/2017 3:39:03 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Jan,

Please attach the document ... there may be ways to doctor your derivative ?
In Smath, the derivative is strictly symbolic from the rules. Often, the rules
are chained to deeply + limits in numerical evaluation.
Glad you rescued the unit system. Attach just the working essentials.

Jean
#15 Posted: 8/22/2017 8:21:09 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Jan,

Please attach the document ... there may be ways to doctor your derivative ?
In Smath, the derivative is strictly symbolic from the rules. Often, the rules
are chained to deeply limits in numerical evaluation.
Glad you rescued the unit system. Attach just the working essentials.

Jean


===============================

Here is a good example the derivative operator fails
but rescued from the incremental derivative.

Jean

Maths Special Polylog Application.sm (21 KiB) downloaded 37 time(s).

#16 Posted: 8/23/2017 6:39:26 AM
Jan Claeys

Jan Claeys

2 likes in 25 posts.

Group: User

Here the resulting file

Solution.sm (103 KiB) downloaded 37 time(s).
#17 Posted: 8/23/2017 6:56:17 AM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Wrote

NOK.sm (15 KiB) downloaded 44 time(s).

OK.sm (60 KiB) downloaded 51 time(s).



I can run both the worksheets without errors (both in SS 0.98.6398 and latest beta)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#18 Posted: 8/23/2017 10:05:56 AM
Jan Claeys

Jan Claeys

2 likes in 25 posts.

Group: User

Hello Davide,

I run the latest beta (build 6437), and f(2) on the last page of "ok.sm" doesn't result in an answer (the standard smath derivative function doesn't work)? I run Windows 7 Pro.
"nok.sm" does work, the reason for this is unclear because exactly the same formulas are used, however the graph doesn't show the correct shape of the derivative function.

It would be very strange if your configuration would be errorless?
There has to be a program mistake somewhere?

Kind regards,

Jan
#19 Posted: 8/23/2017 10:49:12 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Here the resulting file


=================================
* no units are used here to facilitate the "solve" command

In the definition of f(x) for the incremental derivative,
the units in num/den do match and f(x) is pure unitless,
just function of "x". The way you have it works fine.
The curiosity is that if we isolate/export the symbolic
expansion of f(x) ... the system fails ... damned puzzling !

Jean

Solution Isolate_Fails.sm (22 KiB) downloaded 34 time(s).

#20 Posted: 8/23/2017 11:57:54 AM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Wrote

It would be very strange if your configuration would be errorless?
There has to be a program mistake somewhere?


It is strange indeed. Can you confirm that the error display on the uploaded file for you (download > open > error is shown; I mean, there were no issues while choosing the file to upload)
I run the same version as your, on Win7 home. It might be something related to some plugin (to check it you can rename your %APPDATA%\smath folder into something different, then you can load a new instance of SS studio and check if something is changed) or might be something else, I'll try to see if I can found a way to replicate it at least find the cause for that error message.

If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
  • New Posts New Posts
  • No New Posts No New Posts