Partial object gets value zero
Brought to you by:
jrheinlaender
Once I open my document and get this error at the first recalculation:
"While checking equation if->2:dro_sm/dᅬト : power::eval(): division by zero"
The "if->2:dro_sm/dᅬト" equation contains "partial (rho) over partial (t)".
I have represented this bug in the attachment.
Bugs: #24
Bugs: #6
Feature Requests: #15
Anonymous
Isn't that correct? If you differentiate a constant, the result is always zero. So iMath sets partial(tau) = partial(1) = 0.
In any case, partial(h) / partial(1) doesn't make any mathematical sense, does it?
Hi Jan.
Partial(h) / partial(1) is meaningless just because any derivative is not only a fraction, but also another solid function, in this case a function of t:
Partial(h) / partial(t) = h_t'(t). ("_t" means lower index)
VAL (Partial(h) / partial(t)) = h_t'(1) is permitted, but it is not equal to Partial(h) / partial(1). So I don't think that it is correct to substitute "t=1" in "partial (t)".
As I understand this substitution "t=1" happens when iMath tries to find the value of x.
Anyway, in my document, where I've suddenly catched this error, I didn't want to find numerical value of "Partial(h) / partial(t)". There is another variable that is included in some "ifelse" equations with these partials...
Hi Vladislav,
I don't think I can do anything against this wrong substitution of t=1 in partial(t).
Imagine if you write this equation
partial(h) = c * partial(t)
how can iMath know that it is allowed to substitute h=1 but not t=1?
Hi, Jan.
1.Have a look at the attachment, please. This is my doc where I've seen the error first. Because of this error it doesn't work now.
The error window contains the bad equation label. There are several equations there that may be bad too. I've placed its labels near the equations so you don't need to seek them.
When the error appears, the focus moves to the equation in the table below. The equation asks the value of F_о.
2.Maybe such automatic substitutions "t=1" should be disallowed for all partial() and differential() objects? VAL (Partial(h) / partial(t)) doesn't return numeric value anyway. Even if it will be able to do it in future, then the numeric value of t should be substituted in the right-hand side of an equation, but not in the "partial (t)" object itself.
You're right that "partial(h) / partial(1)" doesn't make any mathematical sense. But if we have the equation "t=a", then we get "partial(h) / partial(a)", so this still makes sense. But, anyway, this is not equal to "partial(h) / partial(t)" with "t=a". That's why the VAL() operator should not make such substitutions.
This doesn't apply to the case, when somebody creates an equation, where he/she wants to make such substitution directly.
Last edit: zeon_account_will_be_deleted 2014-10-01
Hi Vladislav,
I think you forgot to attach the file.
Hi Vladislav,
I looked at this file. There doesn't seem to be a really good way to solve it. The real problem is the way that VAL() searches for values:
VAL() takes all the assignments in the document (an assignment gives a value to some variable, e.g. x = 200)
Then it substitutes all these assignments into all the equations in the document to see if more assignments result.
And so on until no new assignments occur or the value we are looking for was found.
Of course there is no intelligence in this, it is just blindly substituting some value into some equation, whether are not this makes mathematical sense.
What I did now is to catch the "division by zero" error (and any other errors) and simply ignore it.
The fact is that there was not this error in the document before. But now it appears and stops a calculation. And I can't prevent it. The only way is to add some equations, that substitute df/dx= <something> in all equations. But this is not clear solution.
BTW The differential, either total or partial, may also be considered as a function of the variable under it. But it is not a derivative. It is actually an increment of the variable.
Consider our case: partial(tau) = partial(1). The meaning of this is not a differentiation of a constant, but a value of an increment of tau at the point tau=1.
If tau is an independent variable, partial(tau)=(0;+inf) at any point. (any positive real number).
There is pretty good explanation on a Wiki. Pay attention at the "History and usage" and at the figure in the "Definition" chapter, please.
Last edit: zeon_account_will_be_deleted 2014-10-10
Hasn't this been fixed yet?
Hi, Jan.
I can't install imath 2.2.0 on LibreOffice 5.3.1.2, Windows 7.
Error message:
loading component library <file: C:="" Users="" Zeon="" AppData="" Roaming="" LibreOffice="" 4="" user="" uno_packages="" cache="" uno_packages="" lu397648jxju.tmp_="" iMath-2.2.0.oxt="" Windows="" iMath-2.2.0-WIN.uno.dll=""> failed
I'm using now imath 2.1.4. When I open file "Bug. Partial object gets value zero 2. Example.odt", LibreOffice falls without any error message.
I don't know what to do. <=/
Hi Jan!
I'd like to up this ticket. I'll try to test thi issue in the version 2.2.2 (I've just installed it).
But also I've found this on the Wiki page:
Well, I'll try to create an example with analytical and graphical explanation.
In short: this is not correct in general case. I think k should be trated as constant if it doesn't have any dependensies of t. So the correct answer should be like this:
g=k * partial(f) / partial(t)
Is it OK to close this?
Hi Jan!
The subject issue is partially solved. But the solution created another issue: the example doc crashes LO during recalculation (Bug. Partial object gets value zero 2. Example.odt).
To find the root of the issue I need to dig deep in that old doc. I don't actually remember which formula can cause it.
Another issue is described above: wrong result of this:
@eq3@ EQDEF g = PDIFFERENTIATE(k * f, t, 1)
I'm not sure we should close it now
Hi zeon,
the example doc does not crash any more on my latest iMath release 2.1.3~beta6.
Also the issue which you show in the last post is a feature, see the Wiki entry for PDIFFERENTIATE.
So if you change the equation to
EQDEF g = PDIFFERENTIATE(k f(t), t, 1)
the result will be as expected.