Reputation
526
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
4 13
Newest
 Scholar
Impact
~14k people reached

Feb
3
comment How can we draw a stencil for discretization of PDEs?
Wow. Thanks. The 3D plot is totally useful for showing the discretizations. Just one quick note. Usually, for the 2D case, the node left to (i,j) is (i-1,j) and the right one is (i+1,j). But here, it is vice versa. Although the plot is correct, I wished to know that how we can reverse this sorting of indices in the code.
Feb
3
comment How can we draw a stencil for discretization of PDEs?
I tried but I failed to build such a piece of code.
Feb
2
comment How can we draw a stencil for discretization of PDEs?
Thanks. I did as you suggested.
Feb
2
comment How Simplify and Assume can be combined on matrix products?
So, how this works in practice. I mean can you revise my above code so as to keep the commutativity while simplifying the Taylor expansion?
Feb
2
comment How can we draw a stencil for discretization of PDEs?
I would like to show the indices, i, j, k and the step-sizes along the three dimensions x,y,z. Furthermore, it would be of interest if e.g. the nine central nodes are colorized with black color and the other nodes are empty.
Jan
26
comment Computing the logarithmic spectral norm rapidly
Great. Thank you so much.
Jan
25
comment Computing the logarithmic spectral norm rapidly
Wow. It gives correct results, but may you please let us know where are "the limit" or "the identity matrix" (which are in the mathematical definition) are?
Jan
20
comment How to speed up filling a matrix as much as possible in a loop?
Yes, the cost of calculating the function is the dominant one. But, when the size of the system becomes large, computing the function evaluations and then filling the matrix becomes slow again. I am trying to solve a discretization nonlinear system resulting from a PDE with the above approach. But for large sizes, it is slow. Maybe, it would be better to incorporate the notion of sparsity in your nice answer.
Jan
19
comment How to speed up filling a matrix as much as possible in a loop?
I have a related observation. For large systems ($n>200$), once again filling the matrix is slow. Do you have any ideas to fill the matrix for sparse cases also too fast?
Jan
18
comment Constructing the coefficient matrix in discretization of a PDE
By theoretical, I mean to have the entries of matrix $A$ in a symbolic way so as to find some region of stability based on the involved step sizes hx and hy along the two spatial directions. I believe that MMA could do that, however I am stuck in filling the matrix $A$ with the above piece of code! I obtained the general discretized formula as you may kindly see above, but I do not know how to deal with the doubled dimensions, i.e., $mn\times mn$. Maybe a reordering of the indices or a Kronecker product could produce the final coefficient matrix for some ordinary values $m=n=6$.
Jan
18
comment Constructing the coefficient matrix in discretization of a PDE
Thanks for the comments. They are very useful. Currently, $F$ is nonlinear and I just wish to apply the method of lines. That is why I am using the finite difference scheme. I know that NDSolve`FiniteDifferenceDerivative is really great, but it is hard to extract the matrices with theoretical entries from it. I mean, that is excellent for numerics. However, if you have some worked examples in 2D case, please put them here. Maybe, they could help more.
Jan
18
comment Constructing the coefficient matrix in discretization of a PDE
I think the matrix $A$ is going to be a block tri-diagonal matrix.
Jan
14
comment How to speed up filling a matrix as much as possible in a loop?
Wow, your answer is unbelievable. It works perfectly and speed up the process of filling the matrix. Thanks a lot.
Nov
19
comment Why doesn't FullSimplify work properly on this?
Note that $1+R+R^2+R^3+R^4+R^5+R^6$ requires 5 multiplications to be implemented, while $1+(R+R^4)(1+R+R^2)$ requires only 3! That is why a more factorized form is desirable.
Sep
6
comment Faster Eigenvalues with lower precision goal
Can anyone extend this answer for the unsolved question at: mathematica.stackexchange.com/questions/29688/…
Sep
1
comment How can you compute Itō Integrals with Mathematica?
Well done. Can you implement the Euler-Maruyama or SRK method for finding the weak solution of Black-Scholes SDE in Mathematica?
Aug
21
comment Is there any fast way to solve a quadratic matrix equation in Mathematica approximately?
The applied norm is optional (Frobenius or Infinity). Just finding some approximate valaues for the scalars in any fast way is needed.
Aug
2
comment How to use adaptive precision in matrix computations?
Can you write it down, please? Does it reduce the whole computational time?
Aug
2
comment How to use adaptive precision in matrix computations?
Thanks for your comment. I do agree. However, I think some built-in functions of MMA already do such an action. An example is the function FindRoot[], which applies the precision of the input data (function and the initial guess) and then improve it per cycle. Also, applying the adaptive precision in matrix calculations (such as the above concrete question/idea) is very good in high precision computing environment. It should reduce the computational time dramatically for large scale problems.
Apr
26
comment How to use Compile for accelerating matrix multiplications?
Please write a code solution based on your tip. I am not familiar with your suggestion.