Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'probleme with eventLocator method' topicStudent Support Forum > General > Archives > "probleme with eventLocator method"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
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: ,

Subject (listing for 'probleme with eventLocator method')
Author Date Posted
probleme with eventLocator method Lyna 05/21/12 04:48am
Re: probleme with eventLocator method Michael 05/25/12 3:30pm
Re: Re: probleme with eventLocator method Lyna 05/29/12 05:44am
Re: Re: Re: probleme with eventLocator method Michael 05/29/12 7:19pm
Re: probleme with eventLocator method Lyna 05/30/12 12:44pm
Re: Re: probleme with eventLocator method Michael 05/31/12 8:34pm
Re: Re: Re: probleme with eventLocator method Lyna 06/03/12 5:03pm
Re: Re: Re: Re: probleme with eventLocator method Michael 06/03/12 10:08pm
Re: Re: Re: Re: Re: probleme with eventLocator ... Lyna 06/07/12 09:08am
Re: Re: Re: Re: Re: Re: probleme with eventLoca... Michael 06/08/12 07:31am
Re: Re: Re: Re: Re: Re: Re: probleme with event... Lyna 06/10/12 06:26am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic