help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculation issue with octave (data unexpectedly go to zero at some


From: Juan Pablo Carbajal
Subject: Re: Calculation issue with octave (data unexpectedly go to zero at some point)
Date: Thu, 27 Feb 2014 23:58:42 +0100

On Thu, Feb 27, 2014 at 11:19 PM, rchretien <address@hidden> wrote:
> Thank you all for your answers.
>
> I understand you better Michael. I have found back a much (much !) simpler
> version of the code, exhibiting the same problem with octave, dating of last
> September, so that it should be simple to launch. Please, find that version
> here :
>
> https://www.dropbox.com/sh/hiuv8u4jxqk2hs3/tI_GfBHJ3Y
>
> Simply uncompress the archive, composed of a minimalistic version of the
> code. To launch it, use the function called main that way :
>
> [expectedPopulationOfGroundState] = main(N)
>
> where N is a parameter denoting the number of realisations of the method (I
> suggest to put N=1, since the problem does not depend on N).
>
> Then, look at what happens when launched under Octave :
>
>
>> expectedPopulationOfGroundState =
>>
>>    0.00000
>>    0.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    1.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>>    0.00000
>
> And what happens when launched under matlab
>
>
>> expectedPopulationOfGroundState =
>>
>>     0.0000
>>          0
>>          0
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>>     1.0000
>
> Since the problem treated here is the spontaneous emission of a photon by an
> atom, the expected population of the ground state is expected to be one when
> the time is large (this explanation is given just in case someone tries to
> understand the code).
>
> Bill, I have read your answer and I am going to test tomorrow since I am
> running out of time tonight. I will provide more details tomorrow if
> necessary.
>
> Once again, thank you for your help.
>
> Best regards,
>
> Renaud
>
>
>
> --
> View this message in context: 
> http://octave.1599824.n4.nabble.com/Calculation-issue-with-octave-data-unexpectedly-go-to-zero-at-some-point-tp4662177p4662452.html
> Sent from the Octave - General mailing list archive at Nabble.com.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave

Look, this is hardly a minimalistic code... Indeed, you can isolate
the problem quit eeasily.
If you just print the value of n inside your function
temporalEvolution (I called main(10)), you will see that indeed n
reaches only up to 27 instead of 51.
This says the mod(t, 0.2/Gamma) is zero only 27 times. So the question
to ask is whether the vector "y" in the following code is the same in
matlab and in octave

Gamma = 1.62e7;
duration = 10/Gamma;
dt = 0.0025/Gamma;
t   = 0:dt:duration;
y = mod (t, 0.2/Gamma);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]