HP Forums
Mechanical Engineering Function library...for free! - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Mechanical Engineering Function library...for free! (/thread-2699.html)



Mechanical Engineering Function library...for free! - acmeanvil - 12-23-2014 02:44 AM

**EDIT: Thanks to compsystems for spotting two errors in the electrical library. As you can see I haven't done all that much with it, but hope to eventually. The zip file attached has the updated version.***

I am posting my mechanical engineering function library (it also has some structural and electrical related libraries as well) for anyone who would like to use/expand it. This is a collection of functions that I have put together for use at work. They are a bit all over the place but are mainly related to statics, and machine design.

The usual caveats apply; it probably has bugs I haven't caught and it contains a bunch of approximations, so if you are calculating a space shot or something equally mission critical double check your calcs. Also, it may duplicate functions already on the Prime, which I haven't looked for.

All the functions are reusable as stand alone elements, or if that is not your thing, they can be all accessed through a series of menus (CHOOSE boxes...) called directly from two top-level functions. There is a README file in the zip that explains how it works and all the functions are listed in the text file labeled "FunctionDefinition.txt". Do read the README file first though.

It is continues to evolve, but I figure I would post the current snapshot.


RE: Mechanical Engineering Function library...for free! - compsystems - 12-23-2014 03:05 AM

Hello

found a small error in the functions 3phaseMotorWattage, This must start with a letter, rmsVoltage the volts_peak identifier appears as local volts.

Please you can format using primecomm-pad

Code:
//Library of Electrical engineering functions seperated by sections
//look for section header with ****
//Nate White, 09 July 2014
//This software is licensed under the terms of the MIT License provided in LICENSE.TXT for reference and found
//at http://opensource.org/licenses/MIT

//AC motor wattage
EXPORT motorWattage(volts,amps,power_factor)
BEGIN
    LOCAL v,a,pf,watts;
    v:=volts;
    a:=amps;
    pf:=power_factor;
    watts:=pf*v*a;
    RETURN(watts);
END;

//DC wattage
EXPORT dcWattage(volts,amps)
BEGIN
    LOCAL v,a,watts;
    v:=volts;
    a:=amps;
    watts:=v*a;
    RETURN(watts);
END;

//3 phase AC motor power
EXPORT 3phaseMotorWattage(volts,amps,power_factor)
BEGIN
    LOCAL v,a,pf,watts;
    v:=volts;
    a:=amps;
    pf:=power_factor;
    watts:=(√3)*pf*v*a;
    RETURN(watts);
END;

//RMS voltage of an AC signal
EXPORT rmsVoltage(volts_peak)
BEGIN
    LOCAL v,rms;
    v:=volts_peak;
    rms:=v/√2;
    RETURN(rms);
END;



RE: Mechanical Engineering Function library...for free! - Brad Barton - 12-24-2014 03:50 AM

Very generous of you. Thanks for sharing.


RE: Mechanical Engineering Function library...for free! - marcusnicolas1 - 12-24-2014 03:52 AM

So is there a library for electrical engineering and where can I find it? Thanks


RE: Mechanical Engineering Function library...for free! - acmeanvil - 12-24-2014 12:33 PM

There is a skeleton of an electrical library in the file "electrical_lib.txt", however, it only has a 4 functions (vs. a 150+ in the other libraries). Also there aren't any "glue" menus to launch the electrical library like the Structural and Mechanical Engineering libraries. I don't do much electrical engineering work so it has not received the attention of the other libraries. Hopefully I will get to add more to it.


Technically, I hoped to eventually have a replacement for the parts of the HP50g equation library that I used. It would be nice to have an better expanded equation library, maybe we could crowd source it here?