![]() ![]() For the order 4 formula, there are some entries in H // which are computed as nonzero. The function to differentiate function y = f ( x ) f1 = sin ( x ( 1 ) * x ( 2 ) ) + exp ( x ( 2 ) * x ( 3 ) + x ( 1 ) ) f2 = sum ( x. The elements of H approximate the second-order partial derivatives of f. The row J(k, :) approximates the gradient of fk,Ī matrix of doubles, the approximated Hessian. JĪ m-by-n matrix of doubles, the approximated Jacobian. The arbitrariness of using the canonical basis to approximate the derivatives of a function. The matrix Q is expected to be orthogonal. QĪ real matrix of doubles, modifies the directions of differentiation (default is Q=eye(n,n)). See the section "The shape of the Hessian" below for details on this option. The available values are "default", "blockmat" or "hypermat". H_formĪ string, the form in which the Hessian will be The available values of order are 1, 2 or 4. If h is not provided, then the default step is computedĪ 1-by-1 matrix of doubles, integer, positive, the order of the finite difference hĪ 1-by-1 or n-by-1 vector of doubles, the step used in the finite difference xĪ n-by-1 or 1-by-n vector of doubles, real, the point where to compute the derivatives. I'm trying to simulate the heat distribution on an infinite plate over time.A function or a list, the function to differentiate. Now, the crucial point of it, is calculation of temperature for all plate points, and it has to be done for every time instance I want to observe: for j=2:S-1 For this purpose, I've wrote a Scilab script. The problem is, that, if I'd like to do it for a 100x100 points plate, it means, that here (it's only for inner part, without boundary conditions), I would have to loop 98x98 = 9604 times, at every turn calculating the heat at a given i,j point. If I'd like to observe that for, say 100 secons, with a 1 s step, I have to repeat it 100 times, giving 960,400 iterations in total. Which takes quite a long time, and I'd like to avoid it. Up to 50x50 plate, it all happens in a reasonable, 4-5 seconds time frame. Now my question is - is it necessary to do all this using for loops? Is there any built-in aggregate function in Scilab, that will let me do this for all elements of a matrix? The reason I haven't found a way yet, is that the result for every point depends on the values of other matrix points, and that made me do it with nested loops. Any ideas on how to make it faster appreciated. It seems to me that you want to compute a 2D intercorrelation of your heat field and a certain diffusion pattern. This pattern can be thought as a "filter" kernel, which is a common way to modify images with a linear filter matrix. If you install the Image Processing Toolbox (IPD) you will have a MaskFilter function to do this 2D intercorrelation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |