comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL LSODE double precision
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
IDL LSODE double precision [message #94663] Wed, 09 August 2017 12:37 Go to previous message
douglas Drumheller is currently offline  douglas Drumheller
Messages: 2
Registered: August 2017
Junior Member
I've used LSODE to solve a simple oscillator problems successfully before in double precision. But for the first time I'm running on a 64-bit machine with Windows 7. One of my old codes starting acting up. So I've boiled it down to a test problem of a simple 2nd order linear harmonic oscillator.

PRO test_LSODE

y=[1.,0]

result=fltarr(100,2)

result(0,*)=y

time=findgen(100)/10.

for i = 1,99 do result(i,*) = lsode(y,0,time(i),'diff')

plot,time,result(*,0)

end

Function diff, t, y
return, [y(1),-!pi^2*y(0)]
end

The plot will be a cosine of 5 complete cycles with a period of 2.

Problems start when you try to use double precision. In fact just changing the first statement to

y=[1.0D0,0.0D0]

will return garbage. I've tried setting the other input variables to double also, but the key is that the input y to lsode can no longer be double precision.

One of things I have noticed is that in single precision LSODE does not alter the input value of y. In double precision it does. I'd be happy with an explanation of LSODE doesn't support double precision, except it did on my old 32-bit machine.

Does anyone know what is going on?
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Fill Missing values with NaN
Next Topic: IDL (8.6.0) Help not working after update to MacOS Sierra 10.12.5

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:02:05 PDT 2025

Total time taken to generate the page: 0.00223 seconds