| Author |
Comment/Response |
Michael
|
06/08/12 07:31am
In Response To 'Re: Re: Re: Re: Re: probleme with eventLocator ...' --------- Hi,
> No more memory available.
Probably some symbol was not initialized or not defined to match its use.
(1) Definition: In some notebooks you have sol[p_?NumericQ] and sometimes sol[p_?NumericQ, t0_]. I suggested one with several extra arguments to use to restart the DE after an Event.
(2) Use: In one notebook, sol[p,..] is called with p = {1, 1.1} which won't match the definition of sol: the p is actually a List but sol is defined only when it is numeric. A list of numbers is not the same as a number. At another point, sol is called with 5 arguments instead of two. In such cases when the use does not match the definition, Mathematica works with sol[..] as a symbolic expression and does not substitute the definition. Since it does not simplify, the expressions Mathematica generates internally get larger and larger and use up more and more memory.
However you choose (1) to define a function, it needs (2) to be used in the same way. The way I called the function, sol[p[[1]], tf], matched the definition in the notebook I was working from (sol[p_?NumericQ, t0_]). That is a syntactically correct way to call the function. So sol[p[[2]], tf] would also be correct. But each would give different mathematical results, so you would have to decide what values to pass to sol.
On my computer, the calculation I posted took 0.028077 sec and less than 60MB to do in the attached notebook.
I hope that helps.
Attachment: aller retour with P-2.nb, URL: , |
|