Recently I needed an algorithm to generate equidistant points inside the unit disk with some of them placed on the boundary (circle). To my surprise, quick search didn’t reveal any simple method for this. Below is obvious solution & code, hopefully it will save some time for others.

MATLAB code:

function [x, y, Nb, Np] = eqdisk(Nr)
%EQDISK Generates equidistant points inside the unit disk.
% Nr [in] - number of radial circles
% x,y [out] - coordinates of generated points
% Np [out] - total number of generated points
% Nb [out] - points on boundary (on r = 1 circle)
dR = 1/Nr;
x(1) = 0;
y(1) = 0;
k = 1;
for r = dR:dR:1
n = round(pi/asin(1/(2*k)));
theta = linspace(0, 2*pi, n+1)';
x = [x; r.*cos(theta(1:n))];
y = [y; r.*sin(theta(1:n))];
k = k+1;
end;
Nb = n;
Np = size(x,1);
end

Algorithm is based on the idea of placing the points on concentric circles with (near-) equal arc length between them. Here is some examples:

Read More »

The post is aimed to summarize various finite difference schemes for partial derivatives estimation dispersed in comments on the Central Differences page. To gather them all in one place as a reference.

Listed formulas are selected as being advantageous among others of similar class – highest order of approximation, low rounding errors, etc. Please use comments to add other schemes.

## Second order

:

(1)

:

(2)

Read More »

Few years ago I have published some ideas on how to improve numerical stability of the Newton-Cotes formulas of closed type. Today I want to apply the same ideas to so-called “open” NC-formulas when boundary points are not used for integral approximation.

Just to remind the basic facts and ideas. Newton-Cotes rules use polynomial interpolation to approximate the function under integral sign. Then integral of the function is assumed to be equal to the integral of the approximating polynomial (which can be computed explicitly).

Idea is simple enough, but it has one serious drawback.

Read More »

Built-in debugger in Visual Studio has very nice extension capabilities. One particularly useful feature – developer can create custom visualizers for his own complex data types. Usually interactive debugger just shows data members of user-defined (and unknown to him) classes and structures, e.g.:

Obviously this is not very handy. In example above `mpreal`

is arbitrary precision floating-point numeric type. It is only natural to show variables of the type as numbers, not as collection of low-level data pointers and properties.

Read More »

New version of QuickLaTeX is out – 3.7.7. Besides improvements in general functionality it includes special features for chemistry-oriented web sites:

- Support of
`myChemistry`

environment `\begin{rxn} ...\end{rxn}`

directly in the text (do not forget to include `myChemistry`

into global/local preamble). Check examples on myChemistry home page. - Correct support of
`ChemFig`

package, no tikzpicture wrapping required anymore. However you have to use `[latex] ... [/latex]`

tags to mark `ChemFig`

code sections. We didn’t implement support `ChemFig`

commands directly in the text since one picture can be generated using long sequence of commands, there is no way for QuickLaTeX to know where diagram starts/ends. Read More »

Today I stumbled across Tikz Diagrams in Math Mode topic on tex.SE. Here is how QuickLaTeX solves the task (example is taken from one of the answers in the thread):

Read More »

LaTeX package `tikZ-timing`

created by Martin Scharrer allows easy typing of timing diagrams (digital waveforms) in offline documents.

With the aid of QuickLaTeX `tikZ-timing`

diagrams can be used seamlessly in the WordPress blogs (or any other website). You can just paste `tikZ-timing`

commands directly in the text – QuickLaTeX will compile them into images and embed in the published page.

Read More »

There are special commands for Laplace-Transformation Symbols in `trfsigns`

package (see The Comprehensive Symbol List, Table 81, page 40): `\laplace `

and `\Laplace `

.

To use them with QuickLaTeX, just include `trfsigns`

in preamble (local or global), e.g:

\[
[+preamble]
\usepackage{trfsigns}
[/preamble]
f(t) \laplace F(s) \qquad F(s) \Laplace f(t)
\]

results in

Can you do that with other LaTeX plugins for WordPress :-)?

QuickLaTeX is free online service which allows LaTeX usage on the web pages.

QuickLaTeX supports `tikZ`

graphics since version 3.7.1.

User can insert `tikZ`

code snippets directly on the page (in WordPress editor) between `\begin{tikzpicture} ... \end{tikzpicture}`

commands. QuickLaTeX will render it into image and place on the page.

Read More »