forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

negative number raised to non integer power

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
ognik



Joined: 04 Feb 2015
Posts: 19

PostPosted: Fri Nov 13, 2015 11:38 pm    Post subject: negative number raised to non integer power Reply with quote

Hi - short story is the Win10 upgrade got stuck in an endless auto-repair loop, had to rebuild my PC to win 7 again. Reinstalled SilverFrost - but a program that ran without error before, now fails with 'negative number raised to non integer power' error.

I am pretty sure I haven't changed the program since I last ran it before the rebuild/reinstall!

So is there a setting I might have forgotten?
Code where it fails is below, alfa = 0, n=4
fails on the term4 calc - I fixed it with making the power 2 and not 2.0 - but I'm sure it was 2.0 before ....
-------------------------------------------
Code:

       !----- Find KE NxN matrix ---- 
        do i=1, n      ! rows
       do j=1, n   ! cols
           If (i.eq.j) then
               term1 = -1.0/12.0
                term2 = (((2.0*n)+alfa+1.0)*(alfa+4.0))/(6.0*(alfa+1.0)*x(i))
                term3 = ((alfa+2.0)*(alfa-5.0))/(6.0*(x(i)**2.0))
           T(i,i) =  term1+term2+term3
            else
                 term1 = ((-1)**(i-j))/(sqrt(x(i)*x(j)))
                term2 = (n/(alfa+1.0)) + (1.0/2.0)
                term3 = (1.0/x(i))+(1.0/x(j))
                term4 = (x(i)+x(j))/((x(i)-x(j))**2.0)
                 T(i,j) = term1*(term2 - term3 + term4)
            end if
      end do
    end do


Thanks
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Sat Nov 14, 2015 8:55 am    Post subject: Reply with quote

You did not provide a definition of x(4), but I could reproduce your problem.

Changed "**2.0" to "**2" and the problem went away with my assumed x.

Could it be a change in FTN95 than **2.0 is no longer changed to **2 (assuming this was once the case, as I do remember this being discussed before.)

John
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group