## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
Sheehan Olver
@dlfivefifty
X  = # some Matrix{Float32}
Y  = # some Matrix{Float32}
Z =  # some Matrix{Float32}
_view(visualize((X,Y,Z),:surface))
@async renderloop(window)
but I now want to update the values of just Z
Simon
@SimonDanisch
Oh sorry! didn't see this
that should be something like:
using GLVisualize;
w = glscreen()
@async GLWindow.waiting_renderloop(w)
X = rand(Float32, 10, 10)# some Matrix{Float32}
Y = rand(Float32, 10, 10) # some Matrix{Float32}
Z = rand(Float32, 10, 10) # some Matrix{Float32}
vis = visualize((X,Y,Z),:surface)
_view(vis)
GLAbstraction.set_arg!(vis, :position_z, rand(Float32, 10, 10))
Sheehan Olver
@dlfivefifty
Thanks!! it works. I'll send you the code. Any easy way to output a movie?
Sheehan Olver
@dlfivefifty
Simon
@SimonDanisch
yes! let me see how it works best currently!
Simon
@SimonDanisch
is the calculation super slow?
Christopher Rackauckas
@ChrisRackauckas
it's using an implicit Euler method
there's a reason why there's so much research in timestepping routines and making ODE solvers faster for stiff equations :smile:
Sheehan Olver
@dlfivefifty
No the calculation is really fast as soon as QR cache is built up
The solve takes about 0.004s though evaluating on the grid is slower, 0.2s, but still 5fps or so
Christopher Rackauckas
@ChrisRackauckas
oh I see, you just cache the QR
how many basis elements does it take (what's the size of the matrix?)
Sheehan Olver
@dlfivefifty
I want to move the evaluation step to the GPU
Christopher Rackauckas
@ChrisRackauckas
I really need to get on-board and take some time learning ApproxFun
Sheehan Olver
@dlfivefifty
It grows adaptively, so Inf x Inf
Christopher Rackauckas
@ChrisRackauckas
but how could you do that on the GPU?
They're awful at dynamic allocation
Sheehan Olver
@dlfivefifty
Just the evaluation step
Christopher Rackauckas
@ChrisRackauckas
(Xeon Phi on the otherhand sounds interesting for this)
Sheehan Olver
@dlfivefifty
This is a 2D Clenshaw
The plotting grid is not adaptive
Christopher Rackauckas
@ChrisRackauckas
what exactly is the evaluation step doing?
assembling a matrix?
Sheehan Olver
@dlfivefifty
No
Evaluating the solution on the grid
Christopher Rackauckas
@ChrisRackauckas
oh I see
Sheehan Olver
@dlfivefifty
Nope
Clenshaws algorithm
Simon
@SimonDanisch
could you turn it into a broadcast, as in f.(matrix), where f is a non allocating pure function?
Christopher Rackauckas
@ChrisRackauckas
oh, so it's the evaluation of the basis, not the projection to the basis?
Sheehan Olver
@dlfivefifty
Simon
@SimonDanisch
@time u=\(QR,C*u;tolerance=1E-5)
5.121884s
that's what I mean with slow, btw ;)
Sheehan Olver
@dlfivefifty
The first step builds up the cache
Simon
@SimonDanisch
but that was the third
am I on some old version, maybe?
Sheehan Olver
@dlfivefifty
@ChrisRackauckas evaluating an expansion in a basis, you don't construct the basis itself (though maybe that's better...) it's a generalisation of Horner algorithm
Christopher Rackauckas
@ChrisRackauckas
I see
so the Clenshaw algorithm is the name for the recursive algorithm for generating the Chebyshev polynomials? And you are not constructing the basis, just evaluating the expansion in the Chebyschev basis until some tolerance is reached?
Sheehan Olver
@dlfivefifty
@SimonDanisch it grows the cache adaptively. The third step the solution is growing so the cache needs to grow. Eventually it saturates and the cache is sufficient
Christopher Rackauckas
@ChrisRackauckas
I'll take my ApproxFun questions over to your channel.
Sheehan Olver
@dlfivefifty
@ChrisRackauckas no you don't generate the basis. It evaluates the expansion directly, in reverse order. So a backward recurrence instead of forward
Simon
@SimonDanisch
hm... it seems like it even gets slower...
I'm on frame 10 and started it a couple of minutes ago
still on 11 ... it definitely gets a lot slower over time...