Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
116 views

When using FindFit to fit a large dataset with multiple sine functions, a step size error occur

My dataset looks like datatandA = Import["dataForQuestionFindFit20240528.csv"]; ListPlot[datatandA] and the corresponding FFT spectrum looks like ...
so_sure's user avatar
  • 495
1 vote
1 answer
359 views

Fitting delay differential equations (DDE)

I have the following differential equations: $$S'(t) = 0.31 S(t) \Big( 1 - \frac{S(t)}{6.19} \Big)- \frac{a}{1 + B(t)} S(t),$$ $$B'(t) = c (1 - B(t)) - d B(t) S(t) - 3 c (1 - B(t - 18)),$$ where $B(t -...
user avatar
1 vote
0 answers
472 views

How to include impulses in differential equations?

I have two coupled differential equations as follows: $$S'(t) = - \frac{a}{1 + B(t)} S(t),$$ $$B'(t) = \frac{c}{1 + S(t)} B(t) (1 - B(t)) - d B^2(t) \Big( \frac{1 - B(t)}{B(t)} \Big)^n,$$ where $a$, $...
user avatar
0 votes
1 answer
214 views

Using ParametricNDSolveValue and MultiNonlinearModelFit to fit an ODE system to datasets

I asked a question here about fitting an ODE system to given datasets. The great answer of @ydd solved the problem nicely. In the mentioned answer, the initial values are taken as the initial points ...
user avatar
4 votes
2 answers
447 views

Modeling experimental data with differential equations

I have the following two sets of experimental data, which show the dependencies of two quantities, namely, $S$ and $B$, on time ($0$ h, $3$ h, $6$ h, $9$ h, $15$ h, $18$ h, $21$ h, and $24$ h): ...
user avatar
0 votes
1 answer
63 views

How to properly expand a list with certain numerical elements?

There is a list with 19 elements ...
Mam Mam's user avatar
  • 1,893
4 votes
4 answers
338 views

Simultaneous nonlinear fitting of two datasets to two trial functions with shared parameters

I'm relatively new to mathematica and stack exchange. Problem Generally my problem concerns finding a simultaneous fit of multiple functions to multiple datasets with shared parameters. I have looked ...
MOOSE's user avatar
  • 317
1 vote
1 answer
388 views

How to get a function out of NDSolve

I solved a function using NDSolve and got a result. I also have a plot of the function. Could someone point me in the right direction how I can print the explicit data points and/or generate a fit ...
Nikolo J Bar's user avatar
4 votes
1 answer
258 views

Fit: Experimental`NumericalFunction error when fitting a black-box function

Bug appearing in at least 12.0.0 and 12.3.1 I'm trying some multidimensional Chebyshev fits. First, define a wrapper to prevent premature symbolic evaluation (I don't want a power series result): <...
John Doty's user avatar
  • 14k
2 votes
2 answers
141 views

Can I impose some a priori constraints on a distribution found by SmoothKernelDistribution?

I use SmoothKernelDistribution (with no options and a single argument — a list of values) to get an approximate reconstruction of a continuous distribution based on ...
Vladimir Reshetnikov's user avatar
3 votes
2 answers
2k views

How to merge two or more curves smoothly?

I have plotted three curves. For each range of $x$, one of those curves is true. On the other hand, finally, the result must be a unified curve. Is there any command to unify these three curves? ...
Perfect Fluid's user avatar
0 votes
1 answer
118 views

How can I define the following function for arbitray values of the arguments?

Consider the following function a[m_, l_] = 1/Log[m/l]; with this function I define ...
PhoenixPerson's user avatar
1 vote
2 answers
532 views

Getting error General::munfl from NonlinearModelFit [duplicate]

I am trying to fit data to a sum of Gaussians. This data is found in a file called lpeff.txt. So I write the following code: ...
Otto's user avatar
  • 11
3 votes
1 answer
387 views

Approximating decay rate of an amplitude and frequency of an oscillating function

I have an InterpolatingFunction constructed from a discrete set of values obtained by numerical methods. Let's denote it $f(x)$. The function demonstrates an ...
Vladimir Reshetnikov's user avatar
0 votes
0 answers
212 views

Energy minimization

I am trying to fit some experimental data, and for that I need to solve the following problems: 1) Minimize the energy of a system of the following form: (Not a code, but editor require it to be so) ...
kek's user avatar
  • 13
3 votes
1 answer
169 views

Increasing the accuracy of the fit when using LinearModelFit

Question: is it possible to increase the accuracy of the BestFit property for LinearModelFit? I have code that uses ...
Anthony's user avatar
  • 163
2 votes
2 answers
455 views

Fitting Asymptotic Ansatz to Numerical solution of Differential equation

Consider the following differential equation: $$ \frac{1}{a} \frac{dy}{dx} = -\frac{1}{y} e^{-\frac{1}{y}} $$ with initial condition $y(0) = 1$ and $a = 10$. This is easily solved numerically with $...
Aegon's user avatar
  • 779
10 votes
2 answers
1k views

Fitting experimental data by using ParametricNDSolveValue and NonlinearModelFit

I am a newcomer to Mathematica. Basically I just want to fit the data (enzyme kinetic data) shown below to a system of odes' by using NonlinearModelFit. The data, an 101x2 array, contains time in the ...
Francesco's user avatar
  • 101
1 vote
0 answers
99 views

Fitting Data to Restriction of Known Function?

So I have a list of data points living in the $(x,y)$-plane. These data points come from a complicated curve in this plane whose exact form is not known! I am hoping to evaluate the Weirstrass-$\wp$ ...
Benighted's user avatar
  • 1,337
5 votes
3 answers
528 views

Fitting data with several peaks

I am trying to fit a set of data with a specific model using the following code. As the figure shows, the fitting procedure is not great. First there is an error message, and as is obvious the fitting ...
thils's user avatar
  • 3,268
25 votes
3 answers
1k views

Exponential fitting - isn't actually a BUG there?

There are many questions on this site about wrong exponential fitting in Mathematica but no one considers this well-known problem as a potential bug. Usually people suggest well-known workarounds ...
Alexey Popkov's user avatar
0 votes
1 answer
132 views

How to fit parameters, not functions?

Given a set of parameters ...
jak's user avatar
  • 950
1 vote
1 answer
172 views

Paramter Scans and $\chi^2$ Test in Mathematica

Is there any in-built function or a recommended package that enables one to find, say, 10 Parameters, which are used as boundary conditions in NDSolve, that minimize $\chi^2$? ...
jak's user avatar
  • 950
4 votes
3 answers
666 views

Use NMinimize instead of FindFit for constrained search (of coefficients)

(My problem is more complex, but let us formulate it through this example) I am trying to find the best polynomial approximation to the following function ...
Kass's user avatar
  • 671
3 votes
1 answer
722 views

Non-linear curve fit problem

I am having a problem with making a fit to data in Mathematica, which may involve my understanding of the methods available. I am trying to fit the derivative of a Frota function (which is a Single ...
Sergey T's user avatar
4 votes
2 answers
472 views

How to use Evaluation Monitor in conjunction with NonlineaModelFit?

I am trying to find out how many function, gradient and hessian evaluations are made when i run NonlinearModelFit for example in this case ...
Jaime's user avatar
  • 41
0 votes
1 answer
234 views

How to adjust excel data for NonlinearModelFit?

I'm really new to Mathematica and I'm facing a problem and would really appreciate some help! Maybe my question is similar to one described in How to fit 3 data sets to a model of 4 differential ...
OlgaE's user avatar
  • 21
4 votes
1 answer
396 views

FindFit runs extremely slow for my Function,how do I optimize this?

My function is the first order Bessel Function, and I am basically just trying to get this to fit in a way that does not take forever. I define the function as follows, (it seems to work faster if I ...
Gregory Fahs's user avatar
1 vote
1 answer
1k views

Fitting data with inclusion of constraints

How do I find a fit for the dataS (see below) with the constraint that the parameter np is an integer, and that the parameters la+lc = 100. A weak attempt at this is provided below for a specific ...
thils's user avatar
  • 3,268
1 vote
1 answer
331 views

Find Numerical Derivatives (With Errors) given some data

I have a question. Suposse I have some data with their respective errors: ...
Alejandro Guarnizo's user avatar
2 votes
1 answer
1k views

Problem with Covariance Matrix Output in NonlinearModelFit

I am running NonlinearModelFit based off of some simulated data and trying to fit to a function with more than one parameter. Eventually, I would like to fit to 5 ...
diracula's user avatar
33 votes
2 answers
8k views

How to fit 3 data sets to a model of 4 differential equations?

I'm a biologist and a newbie in Mathematica. I want to fit three data sets to a model consisting of four differential equations and 10 parameters. I want to find the parameters best fitting to my ...
Stefanie's user avatar
  • 333
17 votes
3 answers
6k views

Finding a fit to a multi-dimensioned function

I have a model function $f:\mathbb{R}^2\rightarrow\mathbb{R}^2$, and a bunch of data points for which I'd like Mathematica to fit for me. Unfortunately FindFit ...
wxffles's user avatar
  • 14.3k
4 votes
3 answers
1k views

Output of NonlinearModelFit differs from the correct result

I'm having a bad time dealing with the NonlinearModelFit in Mathematica 8, since the result given is a bit imprecise. An example is given on potential regression, ...
Frederik Brinck Jensen's user avatar
15 votes
2 answers
2k views

Is it possible to use the LevenbergMarquardt algorithm for fitting a black-box residual function?

I have a black-box multiargument multiparametric function of the type SRD[dataPoint_List,params_List] which accepts experimental data along with the parameters of ...
Alexey Popkov's user avatar