Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
hi wondering if anyone can give me any tips or help? I'm very new to mathcad and using it to create a compressible nozzle with multiphase gas-particle flow. I'm having trouble calculating the velocity of the droplets with an initial velocity of 1. when implementing with rkfixed the vd0 says 'unknown error-ODEtoofewinit'
Any help would be appreciated if theres a better way to solve? thanks
(g=gas, d=droplet)
Solved! Go to Solution.
I had a second look and now am pretty sure that the magnitude of the summand
is causing the error.
Apart from the implicit multiplication mentioned above which I guess should be a "+" these summands are the only difference from the first system which worked.
This summand is a value in the range from 10^2 to 10^23.
I replaced this expression by a simple constant of similar magnitude and rkfixed still would fail:
But as soon as I set CONST to 504 or something lower, the error goes away and we get a solution.
So I guess that the failure lies within the definition of F.drag(z). Are you sure that the magnitude this function evaluates to should be that large?
I have no experience in your field of work but the Problem with your second 'rkfixed' failing is that rho.g is not a scalar but rather a vector with 301 elements - result of the first system of ODEs solved with 'rkfixed'.
Not sure if it makes sense but one way to make the second ODE based on the result of the first ODE system is to create a function for rho.g and use it in the definition of D.dump. Resulting values are rather large as you can see...
Numbers in the magnitude of 10^15 are in the range of the precision limit of the used IEEE number format.
Higher precision can be achieved by increasing the number of intervals. The function value for z=0.3 is now decreased by the factor 100, but the main behaviour is the very same:
Thank you so much for the help, I'm still very much a beginner using this so I appreciate it!
I also have the 2 equations above for vg and v_rel which actually change with length but only seem to output as a scalar, although if i put vg(subscript 20) it will give me a value of a vector. Do you know how I would implement this without an error outputting for the equations after it.
@MC_14395780 wrote:
Thank you so much for the help, I'm still very much a beginner using this so I appreciate it!
I also have the 2 equations above for vg and v_rel which actually change with length but only seem to output as a scalar, although if i put vg(subscript 20) it will give me a value of a vector. Do you know how I would implement this without an error outputting for the equations after it.
If you apply a vector index to v.g you should get an error, not a value or a vector !!??
v.g is a scalar value because T is vector and also it square root is a vector. This vector is multiplied by vector M and Prime has to apply vector scalar multiplication. That's sure not what you intended. If you would like to see the correct vector, you would have to apply the 'vectorize" operator (the arrow over the expression).
But as you need the value(s) calculated via rkfixed in your second ODE, I would rather suggest that you turn all the results of the first rkfixed into functions of displacement z.
I showed how to do this with rho.g but the result of the second rkfixed was awfully wrong because this second ODE is based also on other result of the first system of ODEs.
Once you turned the rkfixed results into functions you can still use them for plotting:
But if you use any of these results in defining another quantity, you must be aware that you not defining a variable but rather a function depending on displacement z:
Doing this with all quantities solving the second ODE works OK and I think we get more meaningful results now.
You have to fix the rest of the worksheet yourself and when you got it to work I would suggest that you use one of Prime's strenghts and apply units right from the start.
Prime 10 worksheet attached
Okay that makes a lot more sense thanks!
Although I still seem to be running into a problem when implementing the same method for another section:
Pls attach your modified worksheet here.
At first sight I don't see why this second system failed.
I noticed that when we evaluate the vector function D.f using the initial values for x and the interval ends for z the values calculated are rather huge.
But I am not sure if this could be the cause for Prime moaning about "This function cannot be used here").
BTW, when I open Prime with English language set I see the same error message as you show in your screenshot, but with German language set, the error message is quite different:
Something along the lines: "Unknown error: A call target caused an exception error."
However, I'm not sure if this could be an indication of a software bug. Perhaps someone else could take a look at it as well.
EDIT: I just tried opening the sheet in Prime 11.0.0.0 (in case its a bug which already is fixed) but to no avail. Only difference was the with language set to German i also get the same error message as in English -> "Diese Funktion kann hier nicht verwednet werden."
Somehow, I don't believe it's a software bug either. Maybe an error or an unfavorable assumption in the formulation of the ODE system?
Just a shot in the dark, but is there really an implicit multiplication meant here in front of the second x1?
Changing it to a "+" as in the first system did not help, though.
Maybe there are other errors?
I had a second look and now am pretty sure that the magnitude of the summand
is causing the error.
Apart from the implicit multiplication mentioned above which I guess should be a "+" these summands are the only difference from the first system which worked.
This summand is a value in the range from 10^2 to 10^23.
I replaced this expression by a simple constant of similar magnitude and rkfixed still would fail:
But as soon as I set CONST to 504 or something lower, the error goes away and we get a solution.
So I guess that the failure lies within the definition of F.drag(z). Are you sure that the magnitude this function evaluates to should be that large?
Hi, I have now changed my mathcad slightly to be more readable and better to understand. Although my D function still seems to say it cannot be used in RKfixed solution, so i am not able to obtain results/graphs.
I can't spot any problems with my equation definitions, can you spot any input errors?
Thanks for all the help!
Sorry, I can't comment on the correctness of your equations as I have no experience in your field of work.
All I can say is that your D function still returns quite huge values and as we have seen before this might (not sure about this) have been the reason for rkfixed failing.
Maybe there is someone here with experience in that area who would be able to provide further insight on this matter.
Your definitions of h(x) and D_Td(z,x) both include an x6 term. However, your ORIGIN is zero, so the maximum subscript allowed in x is 5.
More importantly, you really must include units. The dimensions of the terms 4f/Dh(z) and 2Fdrag(x)/(gamma.x2^2.rhod.Ad) are different (the former is inverse length, the latter is length per unit time) so you can't add them together, as you have done in the gradient definitions.
Alan
I like your definition of the Cd parameter.
It is as though a number of symbols are dancing on the paper.
Success!
Luc
Thank you! My fractions don't always show up so my values appear to float about lol
