Post Reply 
Mechanical Engineering Function library...for free!
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
Post Reply 


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



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