890 questions
0
votes
1
answer
67
views
Exponential Decay Screen Element Animation
Pseudocode:
DistanceToMove = distanceToMove*decayFactor;
xPos = xPos + distanceToMove;
I am attempting to have a screen element begin at a specific place and go to a final position at a decreasing ...
0
votes
2
answers
156
views
how to approximate 2^x and log2(x) where x is an FP number [closed]
I have 2 approximations for both functions, however the log2(x) takes in an FP number, and outputs a fixed point number; and the 2^x takes in an integer, and outputs a floating point number.
the ...
2
votes
1
answer
160
views
How to fit different Exponential models for decay and growth and get the parameters?
I am trying to fit exponential to my data in r to get regression parameters. I would appreciate if you could please help me with. I have tried nls() and didn't work, tried different datasets as well. ...
-1
votes
3
answers
102
views
How to save values to a CSV file in exponent in python [closed]
For a project in Python i have to read float values from an excel file and save it as exponential values in a CSV file by using Pandas. When i print the values, they are shown as exponent, but when i ...
2
votes
1
answer
111
views
How can I set an OFFSET = 100 in nls (Nonlinear Least Squares) coupled with the SSbiexp or SSasympOFF (self-starting) functions in R?
I am using self-starting functions to estimate the best constants for my models in R software. But it does not allow me to constrain my offset (y=100, x=0) to be 100.
The two component exponential ...
0
votes
1
answer
281
views
Plotting exponential trend line
Exponential line that does not fit to along the triangles.
I'm trying to plot the exponential trend line in python. I used following code to plot the exponential trend line. Can anyone help me to ...
1
vote
1
answer
65
views
Exponential function for search algorithm
I implemented a linear function for a search algorithm, that boosts a document according to its time since upload. So the newer a document the more likely it will be presented for a given search term. ...
0
votes
0
answers
53
views
Finding a $ ( non-numberic) in an array of numbers whose N is not known
Recently I got the above question. Here, $ (a non-numeric) data is to be find out in an array whose N (Length) is not known. One simplest approach is linear search by going one by one and comparing ...
1
vote
1
answer
88
views
Error in lm.fit(x,y,offset = offset, singular.ok,...) for exponential lm() model in R
I am trying to apply a exponential regression on the given data frame :
df <- structure(list(Type_stat = c("Vitesse_min", "Vitesse_max", "Vitesse_min",
"...
2
votes
1
answer
220
views
Biexponential fit doesn't match with data
I have a set of data for which I am trying to fit a biexponential function. So far, I have done
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import csv
from ...
1
vote
2
answers
118
views
Sampling from a Superexponential Population in Polynomial Time
I'd like to sample from a well-defined population of super-exponential size with uniform probability among the population. For example, say the population is the set of unique permutations of ...
0
votes
0
answers
115
views
Why does the exponential I'm trying to calculate go to zero even with double precision?
I'm trying to write a program that calculates the kinetic constant of a reaction using partition functions of thermodynamics. However when trying to compute the exponential the exponent is way too ...
1
vote
1
answer
108
views
How do I fit an exponential 3D surface to measured data
This is my data:
[[1.0183786345931547, 1.0299586760768078, 1.038641346963767, 1.0450398412805133, 1.194598528164483], [1.0498980141678536, 1.0740481275807727, 1.101990429736493, 1.1528998376687427, 1....
1
vote
1
answer
73
views
Solving exponential functions in Python with SymPy
I have a small web app that takes 3 points and calculates either a parabola function or an exponential function. Heres the code for the parabola:
@app.route("/calculate/parabola", methods=[&...
3
votes
2
answers
153
views
Why raising a vector of negative values to a fractional power gives NaN [duplicate]
If I generate a vector of values, some of which are negative:
d <- rnorm(1000, 4, 10)
z <- sapply(d, function(x) x^1.2)
z will contain a mix of real values and NaNs. Any values that were ...
-1
votes
1
answer
176
views
Exponential fit is failing in some cases
The following source code is supposed to perform an exponential fit on a number of points.
public class ExponentialFit
{
public static (double A0, double b)? GetExponentialFit(List<double> x,...
-1
votes
2
answers
626
views
Double exponential fit in Python
I have problem related to curve_fit in Python. Specifically, I am trying to model double exponential data.
I am trying to model data. The fits are good by the eye, but when I look at the parameters ...
0
votes
2
answers
794
views
How to do exponential curve fitting for y = a*(1- exp(-b*t) [closed]
I have time series data where values increase over time (t) and then become stable: I would like to fit an exponential curve NPQ_Lss = a*(1- exp(-b*t). Later I would like to compare the fitted curves ...
-4
votes
1
answer
514
views
Java double converts more than 4 decimal points to exponential format and stores the same exponential format in the DB
I have an entity class(Account) wherein I have the following property
@Column(name = "balance", precision = 10, scale = 10, nullable = false)
Double balance;
Then in one of my spring ...
0
votes
1
answer
88
views
Racket// recursive function
as the title says im trying to code recursive for x^n without the expt function. If n is even it should: (x^n/2)^2 otherwise when its uneven x*x(^n-1) and obviously n=0 should be 1.
(define fast-...
0
votes
0
answers
65
views
Code for non-linear constraints in CPlex opl
`Can anyone help me to code this constraint in Cplex opl . It seems to be nonlinear constraint but I do not know how to convert to linear constraint correctly:"enter image description here
l_jt_y[...
1
vote
1
answer
794
views
The decimal value converting to scientific notation in API response if the value is big number
I am working on a GET Request where it should suppose to return the one of key value in the response as 400000000000.00 but in karate framework the key value is being displaying in exponential format ...
-1
votes
1
answer
90
views
calculating r using nth root
I am trying to calculate r at a specific time, or f(t_max). I am using a scale from 0 to 255. So I am trying to calculate the correct rate value for exponential growth at t_max = 255, with an initial ...
0
votes
1
answer
99
views
how can I build a reactive app for choosing the starting values for exponential fit equation?
model equation:
y = H0_1 * (1 - exp(- (Tmax / beta) ^ theta)) + c
Hello, What I'm trying to do is plot an exponential best-fit curve to the data. I'm trying to make my first shiny app with a slider ...
3
votes
1
answer
130
views
Element by element exponential of a sparse matrix in R
I have a large sparse matrix (dgCMatrix) in R, and I would like to have the exponential of each element of this matrix. More precisely, I would like to do 1-exp(-x) to each element of the matrix. ...
2
votes
3
answers
736
views
Adding a trendline in basic R code (no GGPlot) for multiple plot graph of exponential and 2 factor polynomial curves
I am trying to add trendlines to a multi-plot graph using basic R code. Could use some help to to add trendlines for non-linear functions, and am not sure if this is possible with basic R. I may need ...
0
votes
1
answer
626
views
curve fitting exponential function python
I need to apply curve fitting (look at the graph). However, I am struggling to find the initial parameters based on a visual (looking at the plot). So how do I now which value to pick for a, b or c. ...
0
votes
1
answer
76
views
Java Pow Of 2 Gives me a Wrong answer
class Solution {
int mod = (int) (1e9) + 7;
int modPow(long base, long exponent) {
if (exponent == 0) return 1;
long result = 1;
while (exponent > 0) {
...
0
votes
1
answer
439
views
What is the fastest way to do a matrix exponential
I need to calculate the matrix exponential (https://en.wikipedia.org/wiki/Matrix_exponential) for matrices of size upto 1000*1000.
As of now, in python, scipy.linalg.expm (https://docs.scipy.org/doc/...
1
vote
0
answers
61
views
GMP powm function in Rust is giving incorrect results
I cloned this repository to learn more about how it uses gmp within Rust:
https://github.com/poanetwork/vdf
Just for an accuracy check, I wrote a snippet to check the powm function:
let modulushex ...
0
votes
2
answers
221
views
Three variables exponential equations in Python - solver options
Asking here is my last resort, I do not know where else to look or what my next option would be, apart from changing languages.
I have a set of 3 heavy exponential equations, with 3 variables. All ...
-2
votes
1
answer
69
views
Scipy optimize curve_fit not responding properly
from scipy import optimize
import matplotlib.pyplot as plt
x_data = np.linspace(0,11,12)
y_data = np.array([0.02471114, 0.02057292, 0.01752668, 0.01494543, 0.01273249, 0.0110999 , 0.00946524, 0....
2
votes
0
answers
829
views
Formatting numerical tick labels into exponential notation in ggplot2, without rescaling x- or y-axis
I am not very proficient in R, and I have stumbled upon an obstacle when using ggplot2. I have a plot with large numbers on both the x and y axis of the plot. Since I am dealing with large numbers, ...
-1
votes
1
answer
39
views
Iteration algorithm computation TypeError: unsupported operand type(s) for ** or pow() : 'int' and 'tuple'
iteration algorithm code
Code attached at image link above
input:
x = value at which the series is evaluated
es = stopping criterion
maxit = maximum number of iteration
output:
fx =...
1
vote
1
answer
62
views
error messages fitting a non-linear exponential model between two variables
I have two variables that I'm trying to model the relationship between and extract the residuals. The relationship between the two variables is clearly a non-linear exponential relationship. I've ...
0
votes
0
answers
37
views
Avoiding numerical overflow in unavoidable exponent calculation
I am having difficulty doing a Nernst modification to convert a voltage to a concentration gradient.
I have attempted this:
def calc_voltage_offset(self,config):
Voltage = 350 #Voltage in mV, ...
0
votes
1
answer
112
views
How to fix this error message occurring all the time during my non linear regression nlsLM method
I'm still trying to get exponential curve lines on my data. I'm having abundance values in function of time and I want to apply and exponential regression on the first points. I've found a package ...
1
vote
1
answer
482
views
Having trouble fitting an exponential decay model to these data in R:
My problem: I have about 300 rows of data (more variables than the two attached, but only relevant on my end) and need to predict "xaq" (Y) from "seed_prev_num" (x). Their ...
1
vote
1
answer
812
views
Explicit formula for EWMA(n) in Python
I have the following pandas.core.series.Series:
x=pd.Series([17.39, 8.70, 2.90, 1.45, 1.45]) for t=0,1,2,3,4.
When I try x.ewm(span=2).mean() I get the following results:
17.39, 10.87, 5.35, 2.71, 1....
0
votes
2
answers
78
views
Why is there a difference in result between exponential operator and math.pow function for the same arguments passed?
Please refer to the code below:
import numpy as np
x = np.array([[2200,3,4] , [1500,4,2]])
y = np.array([50000 , 45000])
def Predict(x , w , b):
return np.dot(x , w) + b
def Compute_Cost(x , y ,...
-4
votes
2
answers
130
views
I am having a hard time converting fluid dynamics equation into MATLAB code
I converted these two equations into MATLAB code before but I lost the file and now I am trying to write them again but there is a problem and I can't figure it out.
This is the main equation:
This ...
0
votes
1
answer
218
views
How to get a "reverse exponential distribution"?
Suppose I have X patches, and patches have a patch variable called "patch-quality", with values between 0 and 1. I want this patch variable to be generated randomly, but in two different ...
0
votes
1
answer
42
views
'Accidental' Exponentials
(Solved, however I would love to know WHY this happens.)
So,I have this script which should make a huge block of "brick" parts. The idea was for something like breaking them in some way (...
0
votes
1
answer
110
views
Can I solve an objective function with exponential function in C-PLEX or want to linearize it?
This shows the objective function I have tried. It is showing like cannot extract the expression.
1
vote
2
answers
865
views
Curve fitting in python compared to excel (variance in results)
I am fairly new to python, while I have used matlab quite a bit before. Currently I am trying to do an exponential curve fit to a semi logarithmic plot. Down below is the code I've currently got.
...
0
votes
2
answers
72
views
javascript how to express many-digit exponentials to 2 decimal places
I have a javascript program which spits out large arrays of numbers of the form '3.173538947635389377E+98', in the console, and have tried without luck to reduce them to something like '3.17E+98' for ...
0
votes
1
answer
226
views
Decay functions and ggplot - How do I fit a decay function to my data, with conf intervals?
I am working with concentration over time data. The intent is to find a model for the decay rate of the phenol content of algae over time. Not much info is available on the literature about the shape ...
2
votes
1
answer
377
views
I can't fit an exponential function in a data set
I have a data set from a laboratory that I did in which I studied the characteristics of current and voltage in a solar panel. The data is a bit inconsistent but it is visible that it is an ...
0
votes
0
answers
466
views
Exponential conversion to number is wrong in SQL Server
I am inserting some data from python to sql server. In the dataframe, the data looks ok. However after inserting into sql table, the number converts to some exponential expression. I tried to convert ...
0
votes
2
answers
146
views
Python - Calculation that generates array in exponential scale
The logic is to find the average price (and the mode) of a currency where each day (cycle) a fixed percentage is applied to each price of the previous sequence of prices, increasing the value and ...