Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi I have a problem with the definition of functions. I have a function A that references to function B which uses function A from a previous iteration. here's my code (more in xmcd file) |
Thank you for your help
There are three problems here:
I hope this helps.
In addition to what Jeff mentioned, there are more problems. You have a number of variables undefined.
I made an attempt to build an iteration. It 'works' in the sense that it iterates, but not knowing the subject my attempt may be far off the intent.
Anyway:
See if this works for you, or if you can make it work.
Note that 't' is no longer time iteself, but an index into the time points (each Delta-t apart).
In the end you get 4 arrays, and to output them simultaneously (using the augment statement), they HAVE use the same unit. I chose unitless, that's why h.net is divided by its units.
Success!
Luc
They do result in nice graphs:
Hello guys, thank you very much for so many responses! I really appreciate it! Im also sorry for such a late response, havent had much time last days...
I tried last two days to put it together and make it working but without any success. Like you said you have used arrays instead of functions and thats where I lost somehow. I mean I dont understand really the logic of your algorithm.
just for information: Main point of this calculation is to calculate iteratively increasing of temperature of member from air which is increasing temperature.
edit// I understand that i cant write it like that, also i understand that i have to create iterative loop but i dont have any idea how with such complex problem.
edit2// theres error in picture statement "Effective radiation temperature of the fire environment" in mathcad file its correct
I think you need iteration, rather than recursion.
Iteration is a process that uses previous values of an estimated parameter to find better estimates.
Here's an example to find the square root of S:
You need a starting point for your iteration, the example above uses the initial value x.
And you need a stop criterion, like the number of iterations.
You can also use the difference between two estimates, as shown below:
Note that I use an array (R) to hold the iteration values, so I can plot how the iteration reaches its destination:
If you're not interested in how the iteration runs, but only in the end result, you could use:
Success!
Luc
Here is another iteration that involves two parameters that depend on each other:
You can see how X depends on (the previous value of) Y, and Y depends on (the previous value of) X. Finally R is just calculated from the present values of X and Y.