cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Error Generating Multiple Outputs

Muffin83
1-Newbie

Error Generating Multiple Outputs

Hello I have written a program and it uses a while loop to perform iterations on a table of one thousand values.

I am currently hoping to get two output from the table the first being Pcow and the second being SumAw.

I have tried putting them into Matrix at the end but instead I get an error about Units. I am wondering if it is possible to get both outputs into one single table or if it is even possible to just extract both values from the same programming block. I am not really wanting to copy the whole block just to put SumAw at the bottom where Pcow is.

Attached is a copy of the file.
37 REPLIES 37

Russ,

One way or another, you are "solving" in along he path of an asymptotic function. And no CAS will do better than another one, no maths either. A similar situation exists in one of those "free fall" equations. In that last problem that kept me busy several days, I had reached the same limit value found in books, but no further. No matter the epsilon or whatever else, it wouldn't go further. The system is self limiting, as simple as that. Where does it saturates ? Don't know, just the physics of the system. If there is a way to locate ? Don't think so either. The Theta limiting value moves a bit by playing with Alpha.

Teachers love those kind of quiz, they worth points !

jmG

Ya once it was said how it occurs at 74.5 degrees and I confirmed that I had a good idea of what is happening.

Basically in the triangle there is a circle of oil in the middle and water in the corners. We are now injecting water and this will cause the water in the corners to swell. They will not actually move until they med the advancing angle in the first case 30 degrees then 80 and 180.

So basically it hinges or swells out and hits 30 degrees then proceeds to advance out of the corner at the 30 degree angel.

So I think at 74.5 degrees the water is meeting in the middle of the tube before it ever actually advances. So basically the water saturation in that pore is 100% and as a result give my program the error.

Not really necessary for the mathcad part of it but sort of interesting.

So will talk to him maybe he was hoping people would notice it and figure it our or perhaps he maid a mistake. But knowing the man I sort of doubt it but who knows we are all human.

Have a good night guys.


>But knowing the man I sort of doubt it but who knows we are all human <.
_________________________

What matters is that the model agrees with the experiments. Like you say, water does not like oil or vice versa. Fire does no like water but in the forge, pouring water when near white hot, increases the �C past the melting point. That's how old black smith made chains. I have seen and done. That's probably why old black smith had vision problems. The water properties has surely some influence too.

jmG

Hmmm so apparently another classmate of mine talked to the professor and he said that it should work up for 80 degrees. So most likely an error in my code.

Like you Jim as I don't know what was said I have a meeting with him so will have to go and see what he has to say personally. Perhaps have a look at his Fortran code.

rijackson how do I go about limiting the number of iterations and then generating the values I would like. I understand to put the epsilon as a output variable but how do I stop the program at say 100 iterations.

I can trace the epsilon and have done that and it gets close to converging then jumps way out so not sure why it is doing that so would like to see a list of values during the iteration.

Will let you know what me and the professor figure out.
RichardJ
19-Tanzanite
(To:Muffin83)

On 2/25/2009 2:18:51 PM, Muffin83 wrote:

>rijackson how do I go about
>limiting the number of
>iterations and then generating
>the values I would like. I
>understand to put the epsilon
>as a output variable but how
>do I stop the program at say
>100 iterations.

Well, I'd put the code in but you don't seem to have posted a working version of the program. So

Before the loop initialize a counter
i<-0

inside the loop
STORED[i<-epsilon
i<-i+1
If i=100
break

last line of the program
STORED

Richard

>Hmmm so apparently another classmate of mine talked to the professor and he said that it should work up for 80 degrees. So most likely an error in my code <.
_________________________

No natural error in your code, but whereas it uses TOL, COL by default but independently of their external definition that it is normally used to force, you would have to included tol, ctol in the program. There are few sheets doing that but have no immediate recollection where to find.

jmG

Big mistake on my behalf instead of csc should be acos so now got other problems to deal with. For some reason not when I do a water saturation calc it actually gives me a water saturation higher then 100% or (1) so need to look at some more things.

but figured out how to trace multiple variables through a program now to can see what the program is actually doing.

RichardJ
19-Tanzanite
(To:Muffin83)

On 2/25/2009 5:42:27 PM, Muffin83 wrote:

>but figured out how to trace
>multiple variables through a
>program now to can see what
>the program is actually doing.

That certainly makes it easier 🙂

Richard


Top Tags