Post Reply 
Mechanical Engineering Function library...for free!
12-23-2014, 02:44 AM (This post was last modified: 12-23-2014 01:39 PM by acmeanvil.)
Post: #1
Mechanical Engineering Function library...for free!
**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.


Attached File(s)
.zip  Engineering Functions.zip (Size: 49.05 KB / Downloads: 110)
Find all posts by this user
Quote this message in a reply
12-23-2014, 03:05 AM
Post: #2
RE: Mechanical Engineering Function library...for free!
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;
Find all posts by this user
Quote this message in a reply
12-24-2014, 03:50 AM
Post: #3
RE: Mechanical Engineering Function library...for free!
Very generous of you. Thanks for sharing.
Find all posts by this user
Quote this message in a reply
12-24-2014, 03:52 AM
Post: #4
RE: Mechanical Engineering Function library...for free!
So is there a library for electrical engineering and where can I find it? Thanks
Find all posts by this user
Quote this message in a reply
12-24-2014, 12:33 PM
Post: #5
RE: Mechanical Engineering Function library...for free!
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?
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)