Author |
Message |
Dave Gregory (dave)
Junior Member Username: dave
Post Number: 3 Registered: 02-2008
| Posted on Wednesday, March 12, 2008 - 07:24 pm: | |
Hi, I am trying to solve Richards equation,when i run the code it gives type mismatch error.I didn't understand what this error means and how can i correct this error. |
Robert G. Nelson (rgnelson)
Moderator Username: rgnelson
Post Number: 1082 Registered: 06-2003
| Posted on Thursday, March 13, 2008 - 01:03 am: | |
1. I don't get a type mismatch when I run your script. I get an invalid floating point operation, because you are trying to take a negative number to the power 2.0526. Fractional powers are implemented as exp(ln(arg)*power), and negative arguments are illegal. Your C function is ill-behaved. You might want to construct a separate script to compute an plot the values of C. 2. You also have a 1D equation applied on a 2D domain. This allows oscillation in the unused dimension. You should pose it as a 1D domain, or include a diffusion term in the unused dimension to damp oscillations. In the attached script, I have converted to a 1D domain and clamped the argument of ()^q.
|
|