Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Pkg.add("Decimals") # Not needed because this is on juliabox
- using Decimals
- # Defining Variables
- a = Decimal(0.15)
- b = Decimal(0.2)
- c = Decimal(1)
- d = Decimal(-2)
- n = Decimal(-0.5)
- t = 0
- values = []
- column = Dict()
- # Creating the first column
- while n < Decimal(0.5)
- column[n] = a + b*n^1 + c*n^2 + d*n^3
- n = n + Decimal(0.02)
- end
- # Add the first column to the array of values
- push!(next, column)
- # Starting an infinite loop
- while true
- n = Decimal(-0.5)
- column = Dict()
- # Creating the n'th column
- while n < Decimal(0.5)
- index = string(n)
- lastIndex = string(n-Decimal(0.02))
- nextIndex = string(n+Decimal(0.02))
- column[index] = values[end][index] + (values[end][lastIndex]*phi - 2*values[end][n]*phi + values[end][nextIndex]*phi)
- if values[end][n] == values[end][lastIndex]
- break
- end
- n = nextIndex
- end
- if values[end][string(n)] == values[end][string(n-Decimal(0.02))]
- break
- end
- push!(values, column)
- t = t + 4
- end
- println(done!)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement