All Questions
35 questions
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
...
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 -...
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$, $...
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 ...
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):
...
0
votes
1
answer
63
views
How to properly expand a list with certain numerical elements?
There is a list with 19 elements ...
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 ...
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 ...
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):
<...
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 ...
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?
...
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
...
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:
...
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 ...
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)
...
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 ...
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 $...
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 ...
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$ ...
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 ...
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 ...
0
votes
1
answer
132
views
How to fit parameters, not functions?
Given a set of parameters
...
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$?
...
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
...
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 ...
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
...
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 ...
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 ...
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 ...
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:
...
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 ...
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 ...
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 ...
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, ...
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 ...