Providing this 1x1 vector instead of a simple scalar cures the wrong units problem (have no idea as to why it does, though). The wrong unit returned by rkfixed is strange.Īccording to the help (the example there) the initial value should be a vector (a 1x1 vector in your case). In the workaround the "max" function could also be replaced by q*(t)=-K*Re(sqrt(q(t)) with the same effect. The differences can be seen in the next pic and I guess its in a region which is not of interest to you anyway You may consider one of the two workarounds you can see in the picture: It looks like the numerical value of z (or q) is getting negative and so its the root which actually throws this error. I am not sure but the OdeSolve() block seems to fail because of numerical round-offs / inaccuracies. This is often necessary as Primes auto-scaling not exactly the best you can imagine. You should also know that on each axis you can edit the first, second and last scale value (can be quite a fiddling around). I would add, that you may consider formatting the abscissa as hours instead of seconds. You can't use the quickplot feature (plotting without defining the abscissa variable) with units - you have to define a range with units for the abscissa values. Your first question is already answered by Luc. I'd appreciate any help since I need to hand out this assignment soon. The dependent variable column of the output was labeled m*s instead of m. See the glitch with z(t) in the attached worksheet.ģ, I also solved the IVP with rkfixed. However, odesolve was able to integrate only to about t=60000. The exact solution to the problem exists and is well defined up to about t=85000, After that point, the tank is empty and the ODE is undefined. In addition, Mathcad repeatedly changed the units of the t axis from s (which I typed) to 1/s * s, which is incorrect.Ģ. However, it is clear from its formula that h(t) cannot take on infinite or complex values. I received an error message about complex or infinite values. Plotting functions h(t) (the exact closed-form solution) and q(t) (the output from odesolve) did not work for me. (Ordinarily I use Matlab.) My worksheet is supposed to solve the differential equation for liquid spilling out of a small hole in a tank modeled by the ODE dh/dt=-K*sqrt(h) in two ways: odesolve and rkfixed. I am using Mathcad Prime 5.0.0.0, Windows 11, for the first time as instructor in a civil engineering course having taken over from the previous instructor mid-semester.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |