To save others two minutes of their lives :)

https://gitter.im/ApproxFun/ApproxFun.jl

On Wednesday, May 4, 2016 at 3:02:21 PM UTC+8, Sheehan Olver wrote:
>
> Hi Michele,
>
> I'll reply to this in ApproxFun's Gitter, which is is a better forum for 
> ApproxFun specific questions.
>
> Cheers,
> Sheehan
>
>
> On Tuesday, May 3, 2016 at 6:55:07 PM UTC+10, Michele Zaffalon wrote:
>>
>> Hello,
>>
>> I am confused by `ApproxFun.TensorSpace`. I understand the following.
>>
>> dom1, dom2 = Fourier(), Chebyshev()
>> dom = dom1 ⊗ dom2
>> @assert TensorSpace(Fourier(), Chebyshev()) == dom1 ⊗ dom2
>> d1, d2 = Derivative(dom1), Derivative(dom2)
>> @assert Derivative(dom1, 1) == Derivative(dom1)
>>
>>
>> Here are the parts I do not understand:
>>
>> 1) Why doesn't the following evaluate to either error or 0? `dom1` is a 
>> single variable space
>>
>> Derivative(dom1, 2) * Fun([0,0,1], dom1)
>>
>> 2) Why isn't this statement true? `d1` is the partial derivative with 
>> respect to the first variable of `dom`
>>
>> Derivative(dom1) ⊗ I == Derivative(dom, 1) # --> false
>>
>> 3) Sorry for the dumb question but what is `Derivative(dom)`? Is 
>> `Derivative(dom)==Derivative(dom, 1)`? It looks like the following is true 
>> for all `f`
>>
>> (Derivative(dom1) ⊗ I) * f == Derivative(dom) * f == Derivative(dom, 1) * 
>> f # --> true
>>
>> whose first part seems to contradict 2).
>>
>>
>> It looks like negation of derivative for the tensor space is not defined:
>>
>> (-Derivative(dom1)) * Fun([0,0,1],dom1) # valid expression for single 
>> variable function
>> (-Derivative(dom)) * Fun([0,0,1],dom) # invalid expression for the 
>> tensor space
>>
>> Also, I would like to define the divergence and I expect div rot = 0 
>> identically. I fail to define \partial_1\partial_2 but \partial_2\partial_1 
>> works
>>
>> stream_fun = Fun(randn(5), dom)
>> jϕ = Derivative(dom, 2) * stream_fun
>> jz = Derivative(dom, 1) * stream_fun
>> #Derivative(dom, 1) * jϕ #  ∂_1∂_2(stream_fun) --> error
>> Derivative(dom, 2) * jz # ∂_2∂_1(stream_fun) --> OK 
>>
>>
>> Last: `ApproxFun.transform(dom, y)` changes the values of `y` 
>> invalidating the convention about functions modifying its arguments.
>>
>>
>> michele
>>
>

Reply via email to