[Solved] Suggestion: Implement Airy functions

Discuss the spreadsheet application
Post Reply
glhansen
Posts: 15
Joined: Sun Dec 16, 2007 9:18 pm

[Solved] Suggestion: Implement Airy functions

Post by glhansen »

Is there a way to work with Airy functions in Calc? If not, I would like to make a feature suggestion to include them.
Last edited by glhansen on Sun Jun 20, 2021 3:32 pm, edited 1 time in total.
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Airy Functions

Post by Villeroy »

I'm not inclined to google what an airy function could be.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Lupp
Volunteer
Posts: 3542
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Airy Functions

Post by Lupp »

Well, I did duckduck it (and later remembered I had already heard of it).
Anyway:
1. You should create a signature telling what software (AOO or LibO) and version you actually are using.
2. There are lots of special functions used in engineering and physics, and... science.
3. There is mathematical software (some of it free) made for the kind of tasks you may need Airy, and Bessel, and Gamma, and Zeta, and whatever for. Calc will surely not implement that all . 99.9% of the users interested in any "special functions" would excpect that to be something like "FUTUREVALUEMYSTYLE()".
4. AOO is not supposed to create another major release. LibO will, but the main direction of development will be different.
5. The (imo) only way to get what you want is to also think of your quister wanting something related but different, and to create together with hem a feature request concerning the implementation of an interface to Maxima (successor of MIT "macsyma") or similar software already having the needed capabilities, and driven by a community more generally interested in such features.
6. Try bugs.documentfoundation.org/ and wait a few (or more) years. (Yes. They manage feature requests as bugs.)
7. Did you read https://people.eecs.berkeley.edu/~fatem ... enlisp.pdf (e.g.)? Seems to be >17 years old.
Last edited by Lupp on Sun Jun 20, 2021 2:02 pm, edited 4 times in total.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Airy Functions

Post by John_Ha »

Calc is the wrong program unless you want to code it yourself.

Use something like Matlab or Mathematica.

See Comparison of numerical-analysis software

Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
glhansen
Posts: 15
Joined: Sun Dec 16, 2007 9:18 pm

Re: Airy Functions

Post by glhansen »

Airy functions are just another special function, so I didn't think there was that much to say about it. The Python libraries know them, but I'm pretty new to that and I wanted the interactivity of a spreadsheet.

The Wikipedia article explains how they're related to Bessel functions and modified Bessel functions.
https://en.wikipedia.org/wiki/Airy_func ... _functions

I suppose that would be the way to calculate them as functions, but I was really hoping Calc had a function that returns the zeros, since the zeros aren't periodic the way they are in sines and cosines. Looking around, I see the first ten zeros are listed on a NIST web page.
https://dlmf.nist.gov/9.9
They can be copied into a set of tables for reference. Um, even if it has to be done by hand, I can't seem to copy-paste.

So I guess that would be the way forward. I was hoping it could be done more easily by importing an extension or something.
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Airy Functions

Post by Villeroy »

It is possible to write spreadsheet add-ins in Python language. A spreadsheet add-in is an extension which adds cell functions to the spreadsheet component of your office suite. This is not trivial, but once it is done, anybody can add the new bundle of functions within seconds. People are interested in finding such add-ins but not in writing them.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
glhansen
Posts: 15
Joined: Sun Dec 16, 2007 9:18 pm

Re: [Solved] Airy Functions

Post by glhansen »

Correction:

The expression of Airy functions in terms of Bessel functions involves combinations of functions with positive and negative indices, and it seems that Calc turns negative indices into positive indices. So an expression like BESSELJ(x,-1/3)-BESSELJ(x,1/3) will always return 0. In a case like BESSELI(x.1/3)+BESSELI(x,-1/3) it gives an actual number, but it's fooling you because it's really calculating 2*BESSELI(x,1/3).

So I guess that's that.

I want to reply to Villeroy. I thought there must be some way to create add-ons, and I was hoping one was available for me, and that someone would know where to find it. But I'm afraid I'm in the ranks of those who are interested in finding them but not in writing them. I don't have a professional or academic need, I just found some time to work on some math that had been bugging me. To write an add-on, I would have to start from the beginning because I know nothing about it, and barely know Python. I'm sure it must be kind of frustrating, but I'm not ready to start a project like that right now.
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Airy Functions

Post by RoryOF »

My long forgotten knowledge of Bessel functions is that N (the second or order parameter) has to be an integer; if it is not, Calc truncates it.

But there are volunteers on Forum who know more about Bessel functions than I have forgotten, so give heed to them.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Lupp
Volunteer
Posts: 3542
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: [Solved] Airy Functions

Post by Lupp »

The four implemented BESSEL (I, J, K, Y) functions all are specified for non-negative integer N in
Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula
(used by LibO. AOO may still uses an older version.)
There also is the statement "Evaluators may evaluate expressions where N ≥ 0 returns a non-error value." (without explicitly telling what they should actually return in this case). Negative values of N aren't mentioned at all.

Returning a non-error value for N<0 is a violation of the specification (therefore a bug).

@"glhansen":
Why do you ignore the hint concerning your "signature"?
Why do you use the comma as the separator in parameter lists. The semicolon (globally avoiding conflicts with separators inside decimal numbers) is still valid in any LibO, any locale.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
MrProgrammer
Moderator
Posts: 4894
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: [Solved] Airy Functions

Post by MrProgrammer »

glhansen wrote:Is there a way to work with Airy functions in Calc? If not, I would like to make a feature suggestion to include them.
If you aren't interested in implementing this yourself, I am pretty certain that it won't happen. Developers work on features that thousands of people would like, not something one person wants. How much interest about this function is there in the community? This forum has close to half a million posts, but only yours asks about Airy functions.
glhansen wrote:I was hoping it could be done more easily by importing an extension or something.
It might not be difficult if you learn a bit of Python. I implemented an extension about a year ago. I suppose I spent a few days on the project. It has been very helpful to me and I use it every day, so the time was well spent.
glhansen wrote:They can be copied into a set of tables for reference. Um, even if it has to be done by hand, I can't seem to copy-paste.
You're attempting to copy from a PDF in a web page. PDF is a "final form" document, good for viewing and printing, but mostly useless for anything else. It is frequently difficult to "edit", even if that only means copying text for pasting elsewhere. For this situation, the fastest way is to retype the numbers that you see on your screen. Ten function zeros, ten decimals apiece, how long can it take? I'll grant the task is boring.
glhansen wrote:The expression of Airy functions in terms of Bessel functions involves combinations of functions with positive and negative indices …
This idea doen't help with Calc, because none of its Bessel functions is implemented for order ±⅓. If you want to implement that, go right ahead.
glhansen wrote:So an expression like BESSELJ(x,-1/3)-BESSELJ(x,1/3) will always return 0.
BESSELJ(a;n) ignores (truncates) any decimal places of the second operand since it and the I/K/Y variants are only implemented for nonegative, integer orders. Thus =BESSELJ(x;-1/3)-BESSELJ(x;1/3) which is =BESSELJ(x;-0.33333…)-BESSELJ(x;0.33333…) after truncation is =BESSELJ(x;0)-BESSELJ(x;0) and thus zero.
glhansen wrote:it seems that Calc turns negative indices [for Bessel functions] into positive indices.
No, BESSELJ(a;n) returns Err:502 (Invalid argument) if the order n is negative after truncating decimals. For example, =BESSELJ(x;-4/3)-BESSELJ(x;4/3) produces an error.
glhansen wrote:In a case like BESSELI(x.1/3)+BESSELI(x,-1/3) it gives an actual number, but it's fooling you because it's really calculating 2*BESSELI(x,1/3).
Formula =BESSELI(x;1/3)+BESSELI(x;-1/3) is equivalent to =2*BESSELI(x;0).
glhansen wrote:I was really hoping Calc had a function that returns the zeros
It doesn't. But is this attachment providing 50 zeros with ten decimal places good enough?
202106202357.ods
(28.95 KiB) Downloaded 93 times
RoryOF wrote:My long forgotten knowledge of Bessel functions is that N (the second or order parameter) has to be an integer; if it is not, Calc truncates it.
The Bessel functions are mathematically defined for any real order, but only implemented in Calc for nonnegative integer orders. The algorithms for noninteger orders seem to be more complicated.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the subject field. Select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Airy Functions

Post by Villeroy »

Example of a cell function add-in: viewtopic.php?f=20&t=83856&p=389632#p389632
This is an extremely useful one. With 80 lines of Python code, it adds the full power of Python string manipulation.
-------------
My own add-in where I borrowed a Python program by Peter Norvig http://norvig.com, added a little bit of type conversion code and wrapped it into an extension package. It is an array function which takes an array of 9x9 cells and returns an array of 9x9 cells. To be honest, I have only a rough idea how (and how well) Peter's Sudoku solver works. I just analysed the ingoing and outgoing data.

You can import any kind of functionality if you get the data types right.
https://www.openoffice.org/api/docs/com ... AddIn.html
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
jrkrideau
Volunteer
Posts: 3816
Joined: Sun Dec 30, 2007 10:00 pm
Location: Kingston Ontario Canada

Re: [Solved] Airy Functions

Post by jrkrideau »

LibreOffice 7.3.7. 2; Ubuntu 22.04
Post Reply