help-octave
[Top][All Lists]
Advanced

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

Re: Solving 2nd degree differntial equatation


From: Juan Pablo Carbajal
Subject: Re: Solving 2nd degree differntial equatation
Date: Sun, 5 Jun 2016 00:10:46 +0200

On Sat, Jun 4, 2016 at 4:29 PM, Maverick <address@hidden> wrote:
> @Juan Pablo Carbajal-2 I know that results may vary, but difference seems
> just to much for me.
> Alright as you both suggested i tested it with something known:
> x''+x'=0
> x0(0)=2
> x0'(0)=2
> So if I am not wrong solution should be x(t)=C1+C2*e^(-t) And individual
> solution will be
> x(t)=4-2*e^(-t)
> I tested it for T=1, in Wolfram x(T)=3.264241117657... and lsode and RK
> gives 3.26424 which is great and my hopeless Verlet 3.76570. It is quite
> close. But when I try with my first equatation diffrence is much bigger. Now
> I've discovered that for small *k* like 0.5 or less Verlet and RK4 gives
> almost identical results(for my primary equatation). I may assume that my
> implementation is fine, and it's fault of algorithm?
>
>
>
> --
> View this message in context: 
> http://octave.1599824.n4.nabble.com/Solving-2nd-degree-differntial-equatation-tp4677408p4677436.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-octave

Reduce the time step and check again. You probably are comparing with
adaptive sampling algorithms with error control. Also Verlet-veloctiy
is 4th order in dt and is quite good for position dependent force
fields, with relative low complexity (this is the reason why it is one
of the most used algorithms in molecular dynamics...and the fact that
it is symplectic).



reply via email to

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