<PAGE>
                                                                   EXHIBIT 10.31

                                                                       EXECUTION


                FIRST AMENDMENT TO CREDIT AND SECURITY AGREEMENT


         This Amendment, dated as of November 19, 2002, is made by and between
SOUTHERN FLOW COMPANIES, INC., a Delaware corporation (the "Borrower"), and
WELLS FARGO BUSINESS CREDIT, INC., a Minnesota corporation (the "Lender").

                                    RECITALS

         The Borrower and the Lender are parties to a Credit and Security
Agreement dated as of September 24, 2001 (the "Credit Agreement"). Capitalized
terms used in these recitals have the meanings given to them in the Credit
Agreement unless otherwise specified.

         The Borrower has requested that certain amendments be made to the
Credit Agreement, which the Lender is willing to make pursuant to the terms and
conditions set forth herein.

         NOW, THEREFORE, in consideration of the premises and of the mutual
covenants and agreements herein contained, it is agreed as follows:

         1.       Defined Terms. Capitalized terms used in this Amendment which
are defined in the Credit Agreement shall have the same meanings as defined
therein, unless otherwise defined herein. In addition, Section 1.1 of the Credit
Agreement is amended by adding or amending, as the case may be, the following
definitions:

                  "Advance" means a Revolving Advance or a Term Advance.

                  "Availability" means the difference between (i) the Borrowing
         Base and (ii) the outstanding principal balance of the Revolving Note.

                  "Equipment" means (i) the Purchased Equipment and (ii) all of
         the Borrower's equipment, as such term is defined in the UCC, whether
         now owned or hereafter acquired, including but not limited to all
         present and future machinery, vehicles, furniture, fixtures,
         manufacturing equipment, shop equipment, office and record keeping
         equipment, parts, tools, supplies, and including specifically the goods
         described in any equipment schedule or list herewith or hereafter
         furnished to the Lender by the Borrower.

                  "Floating Rate" means (i) with respect to the Revolving
         Advances, an annual interest rate equal to the sum of the Base Rate
         plus one percent (1.0%) and (ii) with respect to the Term Advance, an
         annual interest rate equal to the sum of the Base Rate plus two percent
         (2.0%), which interest rate shall, in each case, change when and as the
         Base Rate changes.

                  "Loan Documents" means this Agreement, the Notes and the
         Security Documents.

                                      A-1
<PAGE>


                  "Note" means the Revolving Note or the Term Note, and "Notes"
         means the Revolving Note and the Term Note.

                  "Purchased Equipment" means the equipment described on Exhibit
         E attached hereto.

                  "Revolving Advance" has the meaning specified in Section 2.1.

                  "Revolving Note" means the Borrower's revolving promissory
         note, payable to the order of the Lender in substantially the form of
         Exhibit A hereto.

                  "Term Advance" has the meaning specified in Section 2.15.

                  "Term Note" means the Borrower's promissory note, payable to
         the order of the Lender in substantially the form of Exhibit D hereto.

         2.       Sections 2.1, 2.2, 2.6(e), 2.10 and 2.11 of the Credit
Agreement are amended by substituting the words "Revolving Advance" for the word
"Advance" and the words "Revolving Advances" for the word "Advances" in every
occurrence in those Sections.

         3.       Section 2.5(a) of the Credit Agreement is amended by
substitution the word "Notes" for the word "Note" in that Section.

         4.       Section 2.6(d) of the Credit Agreement is amended by changing
the name of that Section to "WAIVER OF TERMINATION AND PREPAYMENT FEES" and by
adding "and (h)" to the reference to "subsection (c)" in that Section.

         5.       The following new Section 2.6(h) is added to the Credit
Agreement:

                  "(h)     PREPAYMENT FEES.  If the Term Note is prepaid for any
         reason, the Borrower shall pay to the Lender a fee in an amount equal
         to one percent (1.0%) of the amount prepaid if prepayment occurs after
         the first anniversary of the Funding Date."

         6.       The following new Sections 2.15 and 2.16 are added to the
Credit Agreement:

                  "Section 2.15.  Term Advances.

                  (a) The Lender agrees, subject to the terms and conditions of
         this Agreement, to make a maximum of four advances to the Borrower from
         time to time during the period from the Funding Date to the Termination
         Date (each a "Term Advance"). The Lender shall have no obligation to
         make a Term Advance if: (i) more than sixty days have passed from the
         date of the first Term Advance, (ii) after giving effect to such
         requested Term Advance, the outstanding principal balance of the Term
         Advances would exceed the lesser of $260,000 or 90% of the invoice cost
         of the Purchased Equipment, reduced by the aggregate amount of
         scheduled principal payments described in Section 2.16 or (iii) the
         Lender shall not have received the Invoices, bills of sale and
         confirmation of delivery of the Purchased Equipment, each in substance
         and form acceptable to the Lender in its sole discretion. The
         Borrower's obligation to pay the Term Advance shall be evidenced by the
         Term Note and shall be secured by the Collateral as provided in Article
         III.

                                      A-2
<PAGE>
                  (b) The Borrower shall make each request for a Term Advance to
         the Lender before 11:00 a.m., Denver, Colorado time, one Banking Day
         before the day of the requested Term Advance. Requests may be made in
         writing or by telephone, specifying the date of the requested Term
         Advance and the amount thereof.

                  (c) The request for the Term Advance shall be by an individual
         authorized pursuant to Section 2.2(a).

                  (d) Upon fulfillment of the applicable conditions set forth in
         Article IV, the Lender shall deposit the proceeds of the requested Term
         Advance by crediting the same to the Borrower's demand deposit account
         specified in Section 2.2(b) unless the Lender and the Borrower shall
         agree in writing to another manner of disbursement. Upon the Lender's
         request, the Borrower shall promptly confirm any telephonic request for
         the Term Advance by executing and delivering an appropriate
         confirmation certificate to the Lender. The Borrower shall be obligated
         to repay the Term Advance notwithstanding the Lender's failure to
         receive such confirmation and notwithstanding the fact that the person
         requesting the same was not in fact authorized to do so. The request
         for the Term Advance, whether written or telephonic, shall be deemed to
         be a representation by the Borrower that the conditions set forth in
         Section 4.2. have been satisfied as of the time of the request.

                  Section 2.16. Payment of Term Note.  The outstanding principal
         balance of the Term Note shall be due and payable as follows:

                  (a) Beginning on the earlier of (i) the first day of the month
         following the last Term Advance and (ii) the first day of the third
         month following the first Term Advance, and on the first day of each
         month thereafter, in substantially equal monthly installments equal to
         an amount sufficient to fully amortize the principal balance of the
         Term Note over an assumed term ending on the third anniversary of the
         date of the first principal payment; and

                  (b) On the Termination Date, the entire unpaid principal
         balance of the Term Note, and all unpaid interest accrued thereon,
         shall in any event be due and payable."

         7.       Section 3.6 of the Credit Agreement is amended by deleting the
first sentence in that Section and replacing it with the following sentence:

         "The Borrower authorizes the Lender to file from time to time where
         permitted by law, such financing statements against collateral
         described as "all personal property" or describing specific items of
         collateral including commercial tort claims as the Lender deems
         necessary or useful to perfect the Security Interest."

         8.       Section 6.2(c) of the Credit Agreement is amended and restated
in its entirety to read as follows:

                  "(c)     CAPITAL EXPENDITURES. The Borrower will not incur or
         contract to incur Capital Expenditures of more than $500,000 in the
         aggregate during the fiscal year ending December 31, 2002."

                                      A-3
<PAGE>
         9.       Section 6.3(b) of the Credit Agreement is amended by adding
the following new sentence at the end thereof:

         "Any authorization by the Lender to any Person to amend financing
         statements in favor of the Lender shall be in writing."

         10.      Section 7.1 of the Credit Agreement is amended by adding the
following new phrase at the end thereof:

         "provided, however, that an Event of Default under Section 7.1(u) of
         the Credit and Security Agreement dated September 6, 2002 by and
         between Metretek, Incorporated and Wells Fargo Business Credit, Inc.
         shall not be considered an Event of Default hereunder."

         11.      Section 8.10 of the Credit Agreement is amended by adding the
following sentence at the end thereof.

         "To the extent permitted by law, each Borrower waives and will not
         assert against any assignee any claims, defenses or set-offs which such
         Borrower could assert against the Lender."

         12.      The Credit Agreement is amended by adding Exhibit D, Form of
Term Note, and Exhibit E, Purchased Equipment, both attached hereto.

         13.      Schedule 5.1 of the Credit Agreement is amended by adding the
following new equipment location at the end thereof:

         "300 North Drive, Melbourne, Florida  32934"

         14.      Schedule 6.4 of the Credit Agreement is amended by adding the
following new guaranty at the end thereof:

         "Guaranty of Metretek, Incorporated credit facility dated September 6,
         2002 with Wells Fargo Business Credit, Inc."

         15.      No Other Changes. Except as explicitly amended by this
Amendment, all of the terms and conditions of the Credit Agreement shall remain
in full force and effect and shall apply to any advance or letter of credit
thereunder.

         16.      Amendment Fee. The Borrower shall pay the Lender as of the
date hereof a fully earned, non-refundable fee in the amount of $2,400 in
consideration of the Lender's execution and delivery of this Amendment.

         17.      Conditions Precedent. This Amendment shall be effective when
the Lender shall have received an executed original hereof, together with each
of the following, each in substance and form acceptable to the Lender in its
sole discretion:

                  (a)    The Term Note, duly executed on behalf of the Borrower.

                  (b)    The Acknowledgment and Agreement of Guarantors set
forth at the end of this Amendment, duly executed by each Guarantor.

                                      A-4
<PAGE>


                  (c)    Payment of the fee described in Paragraph 16.

                  (d)    Such other matters as the Lender may require.

         18.      Representations and Warranties. The Borrower hereby represents
and warrants to the Lender as follows:

                 (a) The Borrower has all requisite power and authority to
execute this Amendment and the Term Note and to perform all of its obligations
thereunder, and this Amendment and the Term Note have has been duly executed and
delivered by the Borrower and constitute the legal, valid and binding
obligations of the Borrower, enforceable in accordance with their terms.

                 (b) The execution, delivery and performance by the Borrower of
this Amendment and the Term Note have been duly authorized by all necessary
corporate action and do not (i) require any authorization, consent or approval
by any governmental department, commission, board, bureau, agency or
instrumentality, domestic or foreign, (ii) violate any provision of any law,
rule or regulation or of any order, writ, injunction or decree presently in
effect, having applicability to the Borrower, or the articles of incorporation
or by-laws of the Borrower, or (iii) result in a breach of or constitute a
default under any indenture or loan or credit agreement or any other agreement,
lease or instrument to which the Borrower is a party or by which it or its
properties may be bound or affected.

                 (c) All of the representations and warranties contained in
Article V of the Credit Agreement are correct on and as of the date hereof as
though made on and as of such date, except to the extent that such
representations and warranties relate solely to an earlier date.

         19.      References. All references in the Credit Agreement to "this
Agreement" shall be deemed to refer to the Credit Agreement as amended hereby;
and any and all references in the Security Documents to the Credit Agreement
shall be deemed to refer to the Credit Agreement as amended hereby.

         20.      No Other Waiver. The execution of this Amendment and
acceptance of the Term Note and any documents related hereto shall not be deemed
to be a waiver of any Default or Event of Default under the Credit Agreement or
breach, default or event of default under any Security Document or other
document held by the Lender, whether or not known to the Lender and whether or
not existing on the date of this Amendment.

         21.      Release. The Borrower and each Guarantor by signing the
Acknowledgment and Agreement of Guarantors set forth below, each hereby
absolutely and unconditionally releases and forever discharges the Lender, and
any and all participants, parent corporations, subsidiary corporations,
affiliated corporations, insurers, indemnitors, successors and assigns thereof,
together with all of the present and former directors, officers, agents and
employees of any of the foregoing, from any and all claims, demands or causes of
action of any kind, nature or description, whether arising in law or equity or
upon contract or tort or under any state or federal law or otherwise, which the
Borrower or such Guarantor has had, now has or has made claim to have against
any such person for or by reason of any act, omission, matter, cause or thing
whatsoever arising from the beginning of time to and including the date of this
Amendment,

                                      A-5
<PAGE>
whether such claims, demands and causes of action are matured or
unmatured or known or unknown.

         22.      Costs and Expenses. The Borrower hereby reaffirms its
agreement under the Credit Agreement to pay or reimburse the Lender on demand
for all costs and expenses incurred by the Lender in connection with the Loan
Documents, including without limitation all reasonable fees and disbursements of
legal counsel. Without limiting the generality of the foregoing, the Borrower
specifically agrees to pay all fees and disbursements of counsel to the Lender
for the services performed by such counsel in connection with the preparation of
this Amendment and the documents and instruments incidental hereto. The Borrower
hereby agrees that the Lender may, at any time or from time to time in its sole
discretion and without further authorization by the Borrower, make a loan to the
Borrower under the Credit Agreement, or apply the proceeds of any loan, for the
purpose of paying any such fees, disbursements, costs and expenses and the fee
required under Paragraph 16 hereof.

         23.      Miscellaneous. This Amendment and the Acknowledgment and
Agreement of Guarantors may be executed in any number of counterparts, each of
which when so executed and delivered shall be deemed an original and all of
which counterparts, taken together, shall constitute one and the same
instrument.

         IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be
duly executed as of the date first written above.

WELLS FARGO BUSINESS CREDIT, INC.              SOUTHERN FLOW COMPANIES, INC.



By:      /s/ Patti Scudder                     By:      /s/ A. Bradley Gabbard
         --------------------------------               -----------------------

Name:    Patti Scudder                         Name:    A. Bradley Gabbard
         --------------------------------               -----------------------
                                               Its:     Chief Financial Officer
                                                        -----------------------
Its:     Commercial Banking Officer
         --------------------------------

                                      A-6
<PAGE>

                   ACKNOWLEDGMENT AND AGREEMENT OF GUARANTORS


         The undersigned, each a guarantor of the indebtedness of Southern Flow
Companies, Inc. (the "Borrower") to Wells Fargo Business Credit, Inc. (the
"Lender") pursuant to a separate Guaranty dated as of September 24, 2001 (the
"Guaranty"), each hereby (i) acknowledges receipt of the foregoing Amendment;
(ii) consents to the terms (including without limitation the release set forth
in Paragraph 21 of the Amendment) and execution thereof; (iii) reaffirms its
obligations to the Lender pursuant to the terms of its Guaranty; and (iv)
acknowledges that the Lender may amend, restate, extend, renew or otherwise
modify the Credit Agreement and any indebtedness or agreement of the Borrower,
or enter into any agreement or extend additional or other credit accommodations,
without notifying or obtaining the consent of the undersigned and without
impairing the liability of the undersigned under its Guaranty for all of the
Borrower's present and future indebtedness to the Lender.

                               METRETEK, INCORPORATED



                               By:      /s/ A. Bradley Gabbard
                                        ---------------------------------------
                               Name:    A. Bradley Gabbard
                                        ---------------------------------------
                               Its:     Chief Financial Officer
                                        ---------------------------------------


                               METRETEK TECHNOLOGIES, INC.



                               By:      /s/ A. Bradley Gabbard
                                        ---------------------------------------
                               Name:    A. Bradley Gabbard
                                        ---------------------------------------
                               Its:     Executive Vice President
                                        ---------------------------------------

                               POWERSECURE, INC.



                               By:      /s/ A. Bradley Gabbard
                                        ---------------------------------------
                               Name:    A. Bradley Gabbard
                                        ---------------------------------------
                               Its:     Chief Financial Officer
                                        ---------------------------------------

                                      A-7


<PAGE>
                                      Exhibit D to Credit and Security Agreement

                                    TERM NOTE

$260,000                                                        Denver, Colorado
                                                               November 19, 2002

         For value received, the undersigned, SOUTHERN FLOW COMPANIES, INC., a
Delaware corporation (the "Borrower"), hereby promises to pay on the Termination
Date under the Credit Agreement (defined below), to the order of WELLS FARGO
BUSINESS CREDIT, INC., a Minnesota corporation (the "Lender"), at its main
office in Denver, Colorado, or at any other place designated at any time by the
holder hereof, in lawful money of the United States of America and in
immediately available funds, the principal sum of Two Hundred Sixty Thousand
Dollars ($260,000) or, if less, the aggregate unpaid principal amount of all
Term Advances made by the Lender to the Borrower under the Credit Agreement
(defined below) together with interest on the principal amount hereunder
remaining unpaid from time to time, computed on the basis of the actual number
of days elapsed and a 360-day year, from the date hereof until this Note is
fully paid at the rate from time to time in effect under the Credit and Security
Agreement of even date herewith (as the same may hereafter be amended,
supplemented or restated from time to time, the "Credit Agreement") by and
between the Lender and the Borrower. The principal hereof and interest accruing
thereon shall be due and payable as provided in the Credit Agreement. This Note
may be prepaid only in accordance with the Credit Agreement.

         This Note is issued pursuant, and is subject, to the Credit Agreement,
which provides, among other things, for acceleration hereof. This Note is the
Term Note referred to in the Credit Agreement.

         This Note is secured, among other things, pursuant to the Credit
Agreement and the Security Documents as therein defined, and may now or
hereafter be secured by one or more other security agreements, mortgages, deeds
of trust, assignments or other instruments or agreements.

         The Borrower hereby agrees to pay all costs of collection, including
attorneys' fees and legal expenses in the event this Note is not paid when due,
whether or not legal proceedings are commenced.

         Presentment or other demand for payment, notice of dishonor and protest
are expressly waived.

                                     SOUTHERN FLOW COMPANIES, INC.



                                     By:
                                        ---------------------------------------

                                     Name:
                                           ------------------------------------

                                     Its: -------------------------------------

                                      A-8
<PAGE>


                                      Exhibit E to Credit and Security Agreement

                               PURCHASED EQUIPMENT

<TABLE>
<CAPTION>
       DESCRIPTION                            VENDOR                 ORIGINAL ESTIMATE          INVOICE NUMBER
       -----------                            ------                 -----------------          --------------
<S>                                           <C>                    <C>                       <C>

1.     MPM3000 Screen Printer                 SpeedLine Tech.        $  75,000.00              22202422

2.     Vectra Wave Solder                     SpeedLine Tech.           75,000.00              21202285

3.     JOT Conveyors                          JOT Automation            72,658.20              4267, 4272

4.     JOT Conveyors, Slide Line              JOT Automation                  ___              Quote 2793-01

5.     JOT Conveyors, connecting conveyor     JOT Automation                  ___              Quote 2793-01


6.     BGA Inspection Station                 Starboard Tech.           18,859.48              56816

7.     Additional feeders required for                 ___              29,500.00                    ___
       Ortho contract

8.     Cameras to auto-place BGA's-Fresnel             ___               9,480.00                    ___
       contract
</TABLE>


                                      A-9