Skip to main content
Share Your Experience: Take the 2024 Developer Survey
6 votes
Accepted

Minimize distance between curves

Let's assume you have a set of abscissas $x_i$ and two sets of function values on these grid points $f_i, g_i$ representing the functions $f$ and $g$. As mentioned in the comments, you'll need a model ...
davidhigh's user avatar
  • 3,147
6 votes
Accepted

Parametrized spline - oscilating second derivative

Your choice of parameterization is creating problems. Instead of spanning one in $t$ between points, span an amount proportional to the line segment between the two points in $(x,y)$ space. I've ...
LedHead's user avatar
  • 1,253
3 votes

in Finite Element, which approximation requires less number of unknowns: B-splines vs Shape functions vs Spectral Elements

Based on the comments below your post you may reach the conclusion that # DOFs and speed have no correlation whatsoever - this is not true. Keeping all other things fixed and increasing the number of ...
lightxbulb's user avatar
  • 2,162
3 votes
Accepted

Fitting a monotonically increasing spline function

A smoothing spline might be good enough in your case. For example, scipy.interpolate.UnivariateSpline implements this. You can use it in the following way: ...
Pepe's user avatar
  • 459
3 votes
Accepted

What are the various methods in adding an additional constraint to the quadratic spline interpolation problem

End slope for quadratic splines is a generalization of the natural quadratic spline condition: $p'_0(x_0) = v_0$. Alternatively, you could specify instead $p'_n(x_{n+1}) = v_{n+1}$. Since $\mathcal{C}...
helloworld922's user avatar
3 votes
Accepted

Is a B-spline curve uniquely defined by one set of coefficients?

No, it's not completely unique. Like @origimbo said, a straight line can have many different representations that describe the same curve. Less trivially, splines can be degree-elevated and have ...
CADJunkie's user avatar
  • 383
2 votes
Accepted

B-Splines Matlab Package

You may use Curve fitting toolbox which is provided by MATLAB. The function you need is spcol.
Xi Zou's user avatar
  • 56
2 votes
Accepted

BSplines from scipy not defined on whole range of the knots

The reason your answer differs is because of spline boundary conditions. Consider the spline $B_{j,1}$. To compute this we need $B_{j,0}$, $B_{j+1,0}$, and $\omega_{j,1}$ and $\omega_{j+1,1}$. $$ B_{j,...
helloworld922's user avatar
2 votes

Minimize distance between curves

Here is a simple solution. Find the curve $(x_m, y_m)$ with the largest domain $x$. In your case it is (x2, y2). Assign it to be the main curve and shift all other ...
Vladislav Gladkikh's user avatar
1 vote

Minimize distance between curves

Taking a function as reference $f_r$ the scale-translation transformations for each remaining functions can be handled by minimizing $$ E(a,b,r) = \sum_{k\ne r}^{m}\sum_{j=1}^n \left(f_k(j)a_k+b_k - ...
Cesareo's user avatar
  • 166
1 vote

Spline regularization

As your problem is a local regression problem, I would not use a spline fit, but LO(W)ESS. This estimates $f(x)$ at a sample point $x$ by a weighted least squares fit to the points $x_i$ that are the $...
cdalitz's user avatar
  • 481
1 vote

Accelerating Conjugate Gradients fitting for small localized kernel (like cubic B-spline)

You certainly can try using Gauss-Seidel based preconditioning that is relatively easy to construct and is cheap enough (by my assessment) to give it a try. Other choices of algebraic preconditioners ...
Anton Menshov's user avatar
  • 8,672
1 vote

Integrating/Implementing NURBS-related calculations

I think that you should take a look to OpenCascade. It provides with Spline surfaces, and NURBS particularly. It is written in C++ and it is released under LGPL license. Regarding FreeCAD, I don't ...
nicoguaro's user avatar
  • 8,525
1 vote

How to connect two fitted B-spline curve?

Fitting together B-splines with a given continuity is a hard problem. This was actually the motivation behind developing a generalization of NURBS called T-splines. There are many articles on T-...
CADJunkie's user avatar
  • 383

Only top scored, non community-wiki answers of a minimum length are eligible