Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6088621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:00:23+00:00 2026-05-23T12:00:23+00:00

This first lines work, and i get V(i) =V+QIN(i)-QOUT(i), but when i try to

  • 0

This first lines work, and i get V(i) =V+QIN(i)-QOUT(i), but when i try to do
T(i) = (T + C(i) + TIN(i)*QIN(i)) /((C(i)+QIN(i)), how can I loop trought each C [i],

QOUT=[1.0, 3.0, 1.0, 2.0]
QIN=[2.0, 3.0, 5.0, 2.0]
TIN=[10.0,12.0,13.0, 12.0]

V=[2.0, 4.0, 5.0]

T=[10.0, 11.0, 12.0]

#4 iterations

#V(i) = V+QIN(i)-QOUT(i)

lineNum=0 
for line in range(len(QIN)):
    C = []
    for i in range(len(V)):
        C.append(V[i]+QIN[line]-QOUT[lineNum])     
    lineNum +=1

    print C 

    lineNum=0         
        for t1 in range(len(TIN)):
        Tx=[]
            for c in range(len(C)): 
                for i in range(len(T)):   
                    Tx.append((T[i]*C[c]+TIN[t1]*QIN[lineNum])/(C[c]+QIN[lineNum]))
            lineNum +=1

            print Tx
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:00:23+00:00Added an answer on May 23, 2026 at 12:00 pm

    Sorry could not post images.
    indentation problems are on lines 19,21,23,25,29 – switch special characters on in any editor and you will see them.
    But real cause of problem is in reusing numlines variable, thus it rises IndexError.
    Possible solution:

    QOUT=[1.0, 3.0, 1.0, 2.0]
    QIN=[2.0, 3.0, 5.0, 2.0]
    TIN=[10.0,12.0,13.0, 12.0]
    
    V=[2.0, 4.0, 5.0]
    
    T=[10.0, 11.0, 12.0]
    
    for q_in, q_out in zip(QIN, QOUT):
        C = [v + q_in - q_out for v in V]    
        print C
    
        lineNum=0         
        for t1 in range(len(TIN)):
            Tx=[]
            for c in range(len(C)): 
                for i in range(len(T)):   
                    Tx.append((T[i]*C[c]+TIN[t1]*QIN[lineNum])/(C[c]+QIN[lineNum]))
            lineNum +=1
            print Tx
    

    I assumed you really intended to use linenum in this context…

    PS: for t1 in range(len(TIN)):… part need unfolding to, but I don’t have spirit for this right now

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems fairly trivial but I can't seem to work it out I have
I am trying to get my first spinner to work, and I can't seem
I have an XML file of this Kind : <data> <First id=FirstOne> <lines id=Lines>
I'm using this line to get the beginning time of the first day of
I'm trying to get data from file. The file first has three lines of
I'm trying to work through the Your first NHibernate based application to get the
I'm new to jquery, looked at some tutorials, but I can't even get myself
I'm trying to get this code to work correctly for a school project, these
It's really frustrating. I've always used .val() like this, but now it doesn't work.
I've been seeing this instruction as the very first line of numerous CSS files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.