Proektsoftbg / Calcpad

Free and open source software for mathematical and engineering calculations.
https://calcpad.eu
MIT License
313 stars 38 forks source link

Questions about Calcpad calculator #278

Closed BasilioPV closed 1 month ago

BasilioPV commented 2 months ago

Hi Nedelcho,

It is possible to create a windows app with the calcpad calculator?

image

It is also possible to add uncertain propagation to the calculations (2+-0.005 * 3+-0.009 = 5+-0.007) ??

Best regards,

Basilio

Proektsoftbg commented 2 months ago

Hi!

About the calculator, it is possible, but the question is why is that needed. Actually, this is just a tighter and more restricted UI for the same thing. You can use the current UI also as a simple calculator by entering separate expressions one by one.

About uncertainty propagation, this is not possible in the current version, at least not in some organized and automated way. However, it is always possible to calculate the main values and the resulting uncertainties in separate expressions.

Maybe it will be possible to implement it natively in the future, similar to complex math, and this will be the best option. But now we need to finish the matrices first.

Proektsoftbg commented 2 months ago

Here is some idea to use complex numbers just as a storage for uncertainties but redefine math and output via macros:

image

Here is the code. You can use it if it is something simple:

"Uncertainty propagation using complex numbers
'Define uncertainty propagation operations:
mult(a; b) = Re(a)*Re(b) + Re(a)*Re(b)*srss(Im(a)/Re(a); Im(b)/Re(b))*i
add(a; b) = Re(a) + Re(b) + srss(Im(a); Im(b))*i
'Define macros:
'...
#def un$(a$) = Re(a$)' ± 'Im(a$)
#def mult$(a$; b$)
#hide
c = mult(a$; b$)
#show
#val
un$(a$)'·'un$(b$)' = 'un$(c)
#equ
#end def
#def add$(a$; b$)
#hide
c = add(a$; b$)
#show
#val
un$(a$)' + 'un$(b$)' = 'un$(c)
#equ
#end def
'Usage:
'
a = 2 + 0.005i
b = 3 + 0.009i
mult$(a; b)
add$(a; b)
Proektsoftbg commented 2 months ago

Similar can be done with 2-dimensional vectors in the next version:

image

A bit more elegant, but not as natively implemented. Do you know which software can do such calculations?

BasilioPV commented 2 months ago

Hi!

For me, a "dream calculator" is an algebraic calculator (such as CASIO fx-991), with the size, screen, shape, materials and powering of an SwissMicros DM42:

image

https://www.swissmicros.com/product/dm42

But with native unit management (such calcpad does!) and uncertain management.

The following open source is an approach, but in RPN:

image

https://github.com/apoluekt/OpenRPNCalc?tab=readme-ov-file

See, almost in app, this approach is awesome for me. Since early 90's, CASIO does not release a scientific calculator that fits in your shirt pocket...

image

As engineer, I felt that CASIO abandon us, making big plasticous calculator for school only.

Sorry for the speech :-)

Proektsoftbg commented 2 months ago

I am also a Casio fan. :) I have one on hand for years and in spite all computational powers around, still prefer to quick tap some calcs on it when needed. Cheers!

BasilioPV commented 2 months ago

Similar can be done with 2-dimensional vectors in the next version:

image

A bit more elegant, but not as natively implemented. Do you know which software can do such calculations?

EES (Engineering Equation Solver) has both units and uncertain features.

https://fchartsoftware.com/ees/

It's a great piece of software.