- #71
- 23,583
- 5,824
I would say it looks pretty OK. I haven't checked the coding, but the solution looks like you expected, correct?joshmccraney said:Thanks a ton! So I just finished writing the code. It's at the end of the attached pdf. I put plots in the pdf for a time value of 14 (line 8 in the code) and it ran well. However, if I set ##tf = 15## I get some errors, specifically imaginary parts. My guess is from line 37/38, when the square root is introduced. I should say that if I change line 9 to ##
N = (tf/10)*M^2;## I can run for ##tf## values of 100 and more.
What is your take on this technique? Is this acceptable or should I go for an implicit scheme?
Also, for your curiosity, the percent change in volume was less than 1.5% for the code and pictures I posted. Changing line 9 as suggested and running for ##tf=100## produces a volume change of about 0.003%.
Regarding the need to go implicit, my question is "is computation time a problem?" If not, then I see no need to.
How come you are using such a large M. I would use a value of 20, and then check the accuracy of the solution by redoing the calculation at M = 40. But, I think 20 will be adequate. That should help tremendously with your stability.
What does L(t) look like?
Chet