Skip to main content
1-Visitor
Feb 18, 2013 6:51 PM UTC
Solved

Piece-wise model with system of equations

Hello, I am trying to develop a piece-wise model. Normally I would just use a matrix with i+1 and i. In this case however there is a system of equations that needs to be solved for each piece. I was using the 'given' and 'find' operators for the system of equations but I can't figure out how to do integrate this process with a step-wise procedure. Please find attached my file. I solved the first few pieces by hand just to illustrate more clearly what I am trying to do. Thanks!

19-Tanzanite
Mar 15, 2013 12:54 PM UTC

6 replies

23-Emerald V
Feb 18, 2013 8:09 PM UTC

I haven't looked at your worksheet in detail, but my first impression is that you need to rewrite your ΔC and J equations as functions of i. If you can do this, then you should be able to have one solve block and assign that output from the "Find" to a function and then call that by iterating over i.

If you need to incorporate values from one value of i to the next call, then you will need to add the variable parameters to your function definition; you're probably better of in this instance using a programmed 'for' loop rather than a range variable.

Stuart

Translate
1-Visitor
Mar 14, 2013 6:35 PM UTC

Thanks for your reply and sorry for the delay on my side... I am not sure if I understand your suggestion. I have tried to rework the problem in another way but without any luck (it is attached). How would I use a for loop given that there is a system of equations that needs to be solved 'inside' the loop? Thanks

Translate
1-Visitor
Mar 14, 2013 9:44 PM UTC

Just to explain further, This is an intermediate step, eventually I would like to set up the model to consider a range of dP. I've attached a file to show where I hope to go with all this...

Translate
19-Tanzanite
Mar 15, 2013 12:54 PM UTC