Author Topic: Is there a program where you type in equations and change only variables?  (Read 4370 times)

0 Members and 1 Guest are viewing this topic.

Offline BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
Hopefully in the near future I will be going back to school. As I remember so much of my time was spent doing big long equations that would fill up two chalk boards that only had one, two or three inputs. That takes forever when you have 40 data points you took during the experiment. I remember spend 10 minutes to figure out the equation once let alone multiple times.


Is there something where you type in the equation once then just feed it a few variables click a button then get your answer? I realize you can write computer programs to do this but I'm not a programmer and learning it would take away from my studies.
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11258
  • Country: us
    • Personal site
You can try to do something like this with Excel or OO Calc.

But really, Python is perfect for this kind of stuff. You can start slow with just this basic requirement to evaluate formulas, but then when you need more, it is easy to get what you want. It is extremely easy to get started with Python and not having time is not a good excuse here.

Other options would be Matlab or Octave. Matlab has a $150 personal use licence and I highly recommend it. It is a powerful tool.
« Last Edit: July 22, 2018, 06:52:47 pm by ataradov »
Alex
 

Offline MaxSimmonds

  • Contributor
  • Posts: 29
  • Country: gb
I certainly agree with this. But, as an alternative to Matlab, I've used scilab which is almost identical to matlab, but free!

https://www.scilab.org/ here's a link to the site, it's fairly intuitive to use, and the syntax wouldn't differ much from excel, hence you wouldn't need to be proficient in programming to get to grips with it. You can easily change the variables of your equation, and I'm sure if you need any help with writing the equation it wouldn't take more than a few mins to explain.

hope it helps!
 
The following users thanked this post: NiHaoMike, elecman14, Beamin

Online Berni

  • Super Contributor
  • ***
  • Posts: 4954
  • Country: si
Excel is very good for making little dedicated calculation widgets like this. Mainly because you can lay things out in a logical way and label all the inputs and add instructions next to them.

For calculating things just once on the fly i just use SpeedCalc as a replacement for the windows calculator. You type out the whole equation and it spits out the result and appends it to your calculation history. Simple, free, convenient.

Python is also useful as a calculator as previously pointed out. Typing out a math expression in to the live console just spits out the result and you can use variables to hold intermediate results. However when you close the console its all gone. Alternatively you can get more excel functionality from it by writing your whole calculation into a .py file as a program and running it. Potentially very powerful, but perhaps not as quick and convenient.
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 11885
  • Country: us
If you want something really simple on Windows you could try my little calculator (attached). I wrote it when I wanted something like you describe.

What it does do:
- evaluates simple expressions involving values and variables on the command line
- assigns results to new variables
- permits command line recall to repeat expressions with different values
- calculates exact numeric derivatives of expressions

What it doesn't do:
- trig in degrees
- engineering notation
- binary/octal/hex conversions
- the parallel resistance operator
- save results from one session to the next
 
The following users thanked this post: Beamin

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2300
  • Country: gb
+1 for Octave
https://www.gnu.org/software/octave/
Free, open source and good compatiblity with Matlab for the level you are working at.

Note on Win10 there is slight issue with the command terminal which makes backscrolling impossible right now. A workaround is to type 'pause' command and then you can backscroll. Something changed in Win10 recently to cause this.
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12298
  • Country: au
I would have said Excel first out of the gate - but Open Office Calc uses almost identical syntax and is free.
 

Offline BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
You can try to do something like this with Excel or OO Calc.

But really, Python is perfect for this kind of stuff. You can start slow with just this basic requirement to evaluate formulas, but then when you need more, it is easy to get what you want. It is extremely easy to get started with Python and not having time is not a good excuse here.

Other options would be Matlab or Octave. Matlab has a $150 personal use licence and I highly recommend it. It is a powerful tool.

If python is anything like C you use to make the Arduino work that's more trouble then its worth. I do see the huge value in C but learning it was more of a chore to make my gadgets work then actually building the hardware. These equations are big and long; I didn't think you could put such things into excel. The point is to spend minimal time typing in the equation as it will be different for each experiment. One is probably 1/3 page hand written.
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 11885
  • Country: us
These equations are big and long; I didn't think you could put such things into excel.

Of course you can. But you don't have to put the whole thing into one cell formula. You can break it down into parts.

I and my colleagues set up extremely complex calculations in Excel, including solving sets of non-linear simultaneous equations.
 

Offline BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
These equations are big and long; I didn't think you could put such things into excel.

Of course you can. But you don't have to put the whole thing into one cell formula. You can break it down into parts.

I and my colleagues set up extremely complex calculations in Excel, including solving sets of non-linear simultaneous equations.

I guess when excel first came out people on wall street realized you could do technical analysis with it and make huge amounts of money, or at last had an edge on the firms that didn't. I always feel if I was born 10 years sooner I would be rich like some of my family members that saw the same trends as me but were in a position and had money to start up such businesses. When I was a kid I wanted to buy domains of every company I could think of but my father had the credit card, was a dick, and was opposed to seeing someone else think of an idea that he didn't. Would have saved him thousands in college money. Cocacola.com was the first one I thought of. I would have made hundreds of millions because I wanted to rent the domains.
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11258
  • Country: us
    • Personal site
If python is anything like C
That's the whole point that it is not. But if you don't want to spend 20 minutes to give it a try, then it is probably not for you.

I didn't think you could put such things into excel.
There is no need to think, you can. Well, Excel is capable of it, I don't know if you specifically can.

The point is to spend minimal time typing in the equation as it will be different for each experiment. One is probably 1/3 page hand written.
With Python it is as minimal as it gets. And even C on PC is not all that much more complicated.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11258
  • Country: us
    • Personal site
but my father had the credit card, was a dick
Nope, he was a smart man. Coca Cola could easily take that domain from you for the price of a trademark lawyer.

This type of business is not as profitable as you think.

But this has nothing to do with the topic.
Alex
 

Offline BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
If python is anything like C
That's the whole point that it is not. But if you don't want to spend 20 minutes to give it a try, then it is probably not for you.

I didn't think you could put such things into excel.
There is no need to think, you can. Well, Excel is capable of it, I don't know if you specifically can.

The point is to spend minimal time typing in the equation as it will be different for each experiment. One is probably 1/3 page hand written.
With Python it is as minimal as it gets. And even C on PC is not all that much more complicated.

20 minutes? So it's like Vbasic or regular basic simple? That I could do. If you judge python at 20 minutes how long for C two or three hours? I know to understand C a little bit I watched six hours of tutorials starting with a "hello world" program level. The syntax always screws me up but if its really that simple I would give it a try. Where is my Raspberry pi? Seriously do you remember where I put it? I have a pi nano I want to try out but it takes odd sized connectors. I have never seen connectors that size and don't even know what they are called.
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11258
  • Country: us
    • Personal site
20 minutes? So it's like Vbasic or regular basic simple? That I could do. If you judge python at 20 minutes how long for C two or three hours? I know to understand C a little bit I watched six hours of tutorials starting with a "hello world" program level. The syntax always screws me up but if its really that simple I would give it a try. Where is my Raspberry pi? Seriously do you remember where I put it? I have a pi nano I want to try out but it takes odd sized connectors. I have never seen connectors that size and don't even know what they are called.
What does RPi has to do with anything here? I'm not sure what is the point of this thread if you are going to dismiss all the proposals without evaluating them yourself?

Also cocacola.com was registered in October 1994. I seriously doubt you had Internet access back then.
« Last Edit: July 23, 2018, 04:11:54 am by ataradov »
Alex
 

Offline BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
20 minutes? So it's like Vbasic or regular basic simple? That I could do. If you judge python at 20 minutes how long for C two or three hours? I know to understand C a little bit I watched six hours of tutorials starting with a "hello world" program level. The syntax always screws me up but if its really that simple I would give it a try. Where is my Raspberry pi? Seriously do you remember where I put it? I have a pi nano I want to try out but it takes odd sized connectors. I have never seen connectors that size and don't even know what they are called.
What does RPi has to do with anything here? I'm not sure what is the point of this thread if you are going to dismiss all the proposals without evaluating them yourself?

Also cocacola.com was registered in October 1994. I seriously doubt you had Internet access back then.


My father was an EE where his work paid for a terminal at our house. He was making what he called "the back bone of the internet" and told us how he was going to get rich(er) once his company was listed on the NYSE or "go public". A competitor went public first and later I found my father invested half his money in it hedging his bet. So yes some of us had the internet, it wasn't cheap (hundreds or thousands per month) since we lived beyond some certain distance from the phone company. It was like the BBS systems but slightly faster. One of my friends had it too and we would use email, gopher, telnet or some primitive programs. His dad did some other EE thing for a defense company.

At some point in your life one of your packets of data traveled over one of my fathers boards.


Dismiss proposals? I just said I am going to find my raspberrypi and try python again on your suggestion.  :-// . I also downloaded that .zip file and going to try the free math lab program. The only thing I dismissed was writing in C as it's easier to do the equations, but now I have three options to try.
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11258
  • Country: us
    • Personal site
Dismiss proposals? I just said I am going to find my raspberrypi and try python again on your suggestion.  :-/
Why do you need Raspberry Pi? Do you have a regular computer? Use it.
Alex
 

Offline BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
Dismiss proposals? I just said I am going to find my raspberrypi and try python again on your suggestion.  :-/
Why do you need Raspberry Pi? Do you have a regular computer? Use it.

I originally bought the Pi for its GPIO and if I learn python I can use it instead of the Arduino with the C I have to copy and paste. It would be really cool if there was something like visual basic for the rPi. A program where you don't care about the code looking nice or being efficient, it just needs to do what you need. Like dragging and dropping bits of programs like counters and triggers off the GPIO. A GNU radio style where you visually put the parts together in a flow chart. Also with the rpi you don't have to worry about memory or speed like an Arduino with limited resources.
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11258
  • Country: us
    • Personal site
I originally bought the Pi for its GPIO and if I learn python I can use it instead of the Arduino with the C I have to copy and paste.
Why are you intentionally making things harder for yourself? Using Python  for evaluating formulas and controlling GPIOs are two very different things. You are not going to learn everything in 20 minutes. My estimate was just for the simple calculator-like use.

Arduino and PRi have absolutely nothing to do with this discussion. I don't understand why you are bringing them up.
Alex
 

Offline BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
I originally bought the Pi for its GPIO and if I learn python I can use it instead of the Arduino with the C I have to copy and paste.
Why are you intentionally making things harder for yourself? Using Python  for evaluating formulas and controlling GPIOs are two very different things. You are not going to learn everything in 20 minutes. My estimate was just for the simple calculator-like use.

Arduino and PRi have absolutely nothing to do with this discussion. I don't understand why you are bringing them up.


I don't think in a straight line. I consider all uses at the same time and often bring things up, people will reply with something I didn't think of like "a calculator is easier in python then working the GPIO", that I wouldn't know if I didn't say anything.
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12298
  • Country: au
You seem to be mixing two subjects here - big equation handling and SBC hardware.  That's like trying to make a parachute while you're in free fall.

I'll answer only to the calculation question:
Excel (or OO Calc) can do incredibly complex calculations.  You just have to lay them out in chunks, which a logical approach to the task would naturally lead you to.

I've done a few spreadsheets where one worksheet has some basics - such as input data and results - with the calculations being performed in another worksheet (or two) where hundreds of cells are used.

Also, there are numerous resources for hints and tips on the internet for how to do a wide range of less than obvious tasks.
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Heads up if you want to use OpenOffice: the project was obtained by Oracle and many of the devs fled (or were fired?  it's been a few years).  The project has spiritually continued as LibreOffice.  If you try and download openoffice you will get something that has not had much other than minor maintenance updates for years, and Oracle branding.
« Last Edit: July 23, 2018, 05:33:32 am by Whales »
 

Offline thermistor-guy

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: au
Hopefully in the near future I will be going back to school. As I remember so much of my time was spent doing big long equations that would fill up two chalk boards that only had one, two or three inputs. That takes forever when you have 40 data points you took during the experiment. I remember spend 10 minutes to figure out the equation once let alone multiple times.


Is there something where you type in the equation once then just feed it a few variables click a button then get your answer? I realize you can write computer programs to do this but I'm not a programmer and learning it would take away from my studies.

Long ago I used to use TK!Solver, before someone at work stole my copy: https://en.wikipedia.org/wiki/TK_Solver
It still exists, but it isn't cheap: https://www.uts.com/ItemDetails.asp?ItemID=0100-50-0010-00

The advantage was you could specify some of the input and output values, and it would solve for the unknowns. In other words, it was up to you which variables were inputs and which were outputs, and you could easily reclassify them.
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12298
  • Country: au
Heads up if you want to use OpenOffice: the project was obtained by Oracle and many of the devs fled (or were fired?  it's been a few years).  The project has spiritually continued as LibreOffice.  If you try and download openoffice you will get something that has not had much other than minor maintenance updates for years, and Oracle branding.

 :palm:  Sorry.  My references to Open Office were wrong - it IS Libre Office now.
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
:palm:  Sorry.  My references to Open Office were wrong - it IS Libre Office now.

Don't be sorry.  Name changes like this are an absolute PITA, the fact you know at all is good.

Name discontinuity creates big problems for users, just as much as over-continuity (keeping the name but changing the product).  We're seeing mostly the latter these days (Skype, GNOME, Windows, many game releases reverting to successor's names, etc) so it's easy to forget about the former.

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
If it involves math, Matlab is the answer.  They have a 'personal' license so it's not terribly expensive.  I really like the optional Simulink package.  It includes blocks for creating analog simulations identical in concept to an analog computer.  Very cool!

Fortran - I'm an old time Fortran programmer and I write a lot of demo code to show my grandson how to do various math operations like we did it in the good old days.  Simple things, like Riemann Sums are so easy to demonstrate with Fortran (or any other language).

Desmos.com - absolutely ideal for graphing functions.  This comes up a LOT in working through his Calculus program.

Symbolab.com - if you want to see how to solve math problems, this is the place.  If you subscribe, you can get more detailed solutions but it isn't necessary.

Python and it's numeric libraries - This is the modern way to do math.  Alas, I'm going to stick with Fortran.  Buy books related to Python and Math to get specific help.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf