+ Reply to Thread
Results 1 to 7 of 7

Excel limitations

  1. #1
    Registered User
    Join Date
    02-27-2019
    Location
    Birmingham, UK
    MS-Off Ver
    2016
    Posts
    4

    Lightbulb Excel limitations

    Good morning,

    Nice to meet you all and this is my very first post. I have been using excel for ages, but now I am facing a real problem and I don't know if there is a solution.
    I am doing a model and it is divided into a number of steps. In each of the step, there are some iterative calculations until they converge, and the outputs of one step are the inputs for the following one. With a little number of steps like 3-4 I can change the model as much as I want and it is robust. However, when it comes to a higher number of steps (11), it becomes really sensitive and it collapses with a small change in the overall conditions. Sometimes the errors are #DIV/0 or #NUM, I think it is related to the accuracy and the number of iterations, because it also slows down a lot from step 8-9. I have the maximum amount of iterations (9,999 I think) and the maximum change has to be really small because I use some properties that the magnitude order is 10-5.

    Do you have any suggestion, any idea what could be wrong or any program that could be better to do these calculations? It is worthy to mention that there are no macros at the moment and there are divisions, multiplications and trigonometric functions and some numbers to the power of X, and X could have almost any value. All the cells are checked to not be divided by 0.

    Many thanks and kind regards,
    Jorge

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Excel limitations

    Considering the very specific nature of the questions, I'm not sure we can make specific suggestions without knowing much more detail about your algorithm and the equations you are trying to solve and so on. At this point, I cannot even be sure if the problem is with the spreadsheet programming of the algorithm or if it is an inherent instability in the algorithm that is present when programmed in any programming language.

    In my experience with "circular" calculations, I find that a spreadsheet is much more suited to "linear" calculations. Circular calculations can be tricky to program into a spreadsheet. Assuming equal familiarity with the language, I find that numerical, circular, trial and error type algorithms are often easier to program in symbolic languages (like VBA, Python, C, etc.) or maybe something built for more intense math (like MathCad or Mathematica). The loop and variable structures available in these other languages make it easier to control convergence criteria, test for divergence, and other challenges that are part of these numeric algorithms. However, simply changing programming languages cannot cure the inherent instabilities in the chosen numeric algorithm. If that means that you need to learn a new programming language from scratch, you also need to figure that effort into the task.

    Without knowing the specifics of your algorithms, I don't think we can make any specific suggestions. If you will help us understand the algorithm(s) you are using, what causes the instabilities in the algorithms, how you have programmed them into the spreadsheet, and so one, we may be able to make some specific suggestions. If you will tell us what other programming languages you have access to, then we might be able to make suggestions in that direction.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    02-27-2019
    Location
    Birmingham, UK
    MS-Off Ver
    2016
    Posts
    4

    Re: Excel limitations

    Many thanks for your reply. The process I am doing is a design of a chemical reactor and to do it, I divided it into small pieces of reactor. I have to start having a hypothetical exit temperature of a step to calculate the properties of the gases and the heat flows. Once the heat flows are calculated, I calculate the new exit temperature with the formula, and that is where the iterations start. It iterates until the exit temperature converge with the heat supplied and the properties of the gases.
    I hope this helps to understand the process. Otherwise, I will give a more detailed description. The calculations are not "difficult" although there are a lot and it could take me 10 years to solve a single step, that is why I thought Excel would be a good tool to solve it.

    Many thanks!




    Quote Originally Posted by MrShorty View Post
    Considering the very specific nature of the questions, I'm not sure we can make specific suggestions without knowing much more detail about your algorithm and the equations you are trying to solve and so on. At this point, I cannot even be sure if the problem is with the spreadsheet programming of the algorithm or if it is an inherent instability in the algorithm that is present when programmed in any programming language.

    In my experience with "circular" calculations, I find that a spreadsheet is much more suited to "linear" calculations. Circular calculations can be tricky to program into a spreadsheet. Assuming equal familiarity with the language, I find that numerical, circular, trial and error type algorithms are often easier to program in symbolic languages (like VBA, Python, C, etc.) or maybe something built for more intense math (like MathCad or Mathematica). The loop and variable structures available in these other languages make it easier to control convergence criteria, test for divergence, and other challenges that are part of these numeric algorithms. However, simply changing programming languages cannot cure the inherent instabilities in the chosen numeric algorithm. If that means that you need to learn a new programming language from scratch, you also need to figure that effort into the task.

    Without knowing the specifics of your algorithms, I don't think we can make any specific suggestions. If you will help us understand the algorithm(s) you are using, what causes the instabilities in the algorithms, how you have programmed them into the spreadsheet, and so one, we may be able to make some specific suggestions. If you will tell us what other programming languages you have access to, then we might be able to make suggestions in that direction.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Excel limitations

    I'm sure a spreadsheet can be programmed to solve this. I'm equally sure that any number of other programming languages could also be used. However, while I don't use them, most of my clients doing this sort of thing use any one of the available process simulators to perform this kind of work. If this is the kind of thing you are going to do frequently, a commercial program like Hysys could be a good investment. I have also seen an open source simulator called dwsim that may be helpful if cost of a commercial product is prohibitive. Unless there is a reason that you must be the coder for the entire set of calculations, I might suggest looking into a process simulator to perform this work.

  5. #5
    Registered User
    Join Date
    02-27-2019
    Location
    Birmingham, UK
    MS-Off Ver
    2016
    Posts
    4

    Re: Excel limitations

    Thanks again MrShorty. Do you think it is necessary to program it, I mean, I am doing it without any programming and as far as I could I would like to keep it without any macro (although eventually I will have to use them), I prefer to wait until I don't have any other choice.

    Jorge

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Excel limitations

    So, you did not like the idea of using a process simulator for this?

    I don't understand what you mean by "it is necessary to program it..I am doing it without any programming". Maybe because, in my mind, what you are doing in the spreadsheet is very much a programming exercise. It is a very different language (a "spreadsheet language") than what we typically think of when we think of a programming language, but it involves all of the same tasks as programming the same thing in other languages.

    I believe that this sort of thing can be programmed into the spreadsheet using a spreadsheet programming language. However, the loop structures in the spreadsheet language are difficult to use. When you have multiple loops with more complex logic, it is still possible, but it is even more difficult. I don't think it is absolutely necessary to switch to another programming language, but I think it will be easier in the long run.

    As one who generally prefers the spreadsheet language, a strategy I often find myself using is to take identifiable portions of the algorithm and putting them into User Defined Functions (UDFs). For example, you talk about calculating the properties of the gases. If I assume you are using an equation of state (probably one of the common cubic EOS's -- maybe one of those based on VanDerWaal's equation) for these properties, I would be tempted to make a UDF that takes the temperature, pressure, gas composition, and critical properties from the spreadsheet, solves the EOS, and outputs the desired properties back into the spreadsheet. A well designed UDF should be able to seamlessly integrate back into the spreadsheet programming language, in that you can use the function like you would any of Excel's built in functions. It simplifies the spreadsheet language by taking the loops necessary for solving the EOS out of the spreadsheet and isolates them in a single function. If you are interested in learning more about this strategy, you might review this tutorial I made for building simple UDFs: https://www.excelforum.com/tips-and-...uild-udfs.html

    You have undertaken a significant project here. It can be done in a spreadsheet. If I were doing this in a spreadsheet, I would expect to use some outside resources (like UDFs) to simplify the spreadsheet programming part.

  7. #7
    Registered User
    Join Date
    02-27-2019
    Location
    Birmingham, UK
    MS-Off Ver
    2016
    Posts
    4

    Re: Excel limitations

    Dear MrShorty,

    Many thanks again for your answer and understanding. What I meant by "it is necessary to program it" was using macros, I think you call them UDF. Anyway, I will take a look and think what I can code to make the function easier (because I don't see that much complexity right now) but thanks for the help.

    Regards,
    Jorge

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Limitations of Excel
    By wrybel in forum Excel General
    Replies: 3
    Last Post: 04-26-2017, 05:25 AM
  2. Excel limitations
    By esahakos in forum Excel General
    Replies: 1
    Last Post: 12-15-2016, 07:42 AM
  3. [SOLVED] row limitations on excel
    By Pamela in forum Excel General
    Replies: 6
    Last Post: 07-11-2006, 10:20 PM
  4. Excel Row limitations
    By Harry88 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2006, 03:49 PM
  5. [SOLVED] Excel limitations
    By Gary B in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-28-2006, 10:15 PM
  6. [SOLVED] excel limitations
    By TUNGANA KURMA RAJU in forum Excel General
    Replies: 3
    Last Post: 11-24-2005, 02:50 AM
  7. [SOLVED] Excel Limitations
    By JAKOMO in forum Excel General
    Replies: 3
    Last Post: 09-26-2005, 10:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1