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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Error while solving ODE

Mech_Engineer
1-Newbie

Error while solving ODE

I am attempting to solve a kind of tedious pair of coupled diffential equations, and after a lot of trial and error I still can't get them to solve. After getting the boundary conditions defined and non-dimensionalizing the equations, I get an error which states: "The return value of this function must match the problem size." I haven't run into this error before, so I'm at a loss as to what might be wrong with the setup (perhaps the equations aren't converging?)

Any help or guidance you can give me would be greatly apprecaited. I have attached the sheet for those who are interested..
4 REPLIES 4

Post work sheets, not *.zip.
For more help, "Save as" lower versions (Typical 11, 8 ...).

jmG

Your temperatures are inconsistent. YOu have the atmospheric temperature set to 70°F, but also have hard coded 300K (a different temperature) in many places. The result is that the initial pressure in V2 is less than atmospheric pressure, and your equations result in imaginary quantities. I set the temperature to 300K to get a solution.

After that you still need to limit the integration time, as your equations apparently allow the pressure to fall below atmospheric pressure (probably an error, possibly just round off) at which point you get the imaginary results.

Don't use Radau. It is unreliable. The best general solver is the adaptive one.

For posting you should post the worksheet file itself, not a zip file. For size considerations, use the XMCDZ (compressed) format, with the file options set not to include rendered images.

Your equations are a bit confusing, as you copy some complicated expressions rather than use simple functions to express the pressure. I didn't fix that.
__________________
� � � � Tom Gutman

Thank you for your help!

You're right, I got sloppy with my temperature units and helper functions. I was trying to eliminate possible causes of the error I was seeing, so I started copying functions directly into the differential equation solve block.

Thanks for your help again, now I can clean up the worksheet and go back to the helper functions.

What is "helper functions" ?

jmG
Top Tags