378 questions
-1
votes
1
answer
28
views
Anylogic INtroducing time fluctuations in a dynamic variable
To simulate time variations of economic activity I need to create a fluctuation in time by, as example a sinusoidal function as a positive/negative effect on employement rate.
How can I do this in a ...
0
votes
1
answer
92
views
Julia throws MethodError: no method matching, with CoolProp using NonlinearSystem
I'm trying to get Julia's NonlinearSolve to play well with CoolProp. I am very new at Julia, coming from many years of Python, so I am still learning the ropes.
This is the code that is giving me ...
1
vote
1
answer
48
views
Implement Variable Step Size for Nonlinear Function MATLAB
I have the following function that returns a nonlinear signal as a function of time:
function y = NARMA_optimized(u,mu,delta,phi,psi,m,N,k)
y = zeros(N,1);
% y(0)=0, and also y(-1)=0 etc.
t = 1;
y(t) =...
0
votes
1
answer
33
views
Simple NN aiming to learn a of non-linear equations can't converge
I've got a bunch of equations using sums, multiplication and min(x,0) or max(x,0) that yield a result (one output, 18 inputs).
I'm trying to have an NN model in pytorch learn these so I generate quick ...
1
vote
2
answers
92
views
Solve a set of nonlinear equations for a discrete value in SymPy
I'm trying to solve a system of nonlinear equations for a discrete value in SymPy. The system constists of 7 equations.
Here's my code:
import math
from CoolProp.CoolProp import PropsSI
import sympy ...
0
votes
1
answer
58
views
Python solver returns no values upon running the code
I need to calculate the vertical natural frequency and the horizontal natural frequency of a beam. In order to do this I have been given two values of the vertical and horizontal natural frequency ...
0
votes
1
answer
79
views
Excel 365 Back Calculate Cleaned Data to Raw Data
My Problem:
I am using the Microsoft 365 Excel app for desktop.
My dataset comes from a programmed tool that collected raw data and automatically converted it to the final value using an equation I ...
-1
votes
1
answer
57
views
Seeing more detail from a graph of nonlinear equations [duplicate]
I have a plot of isocontours for nonlinear system of functions and I I'm trying to get more detail in the graph. I know for sure that there are 3 more isocontour (island shapes) inside the iscontour(...
0
votes
1
answer
154
views
Non-linear regression analysis with a floor function on (X)
I have created a data set to understand better an equation and apply it to predict behavior.
The equation is y = 10/(1+k*⌊((x/t)^s)⌋).
To create the data set and see if it is working properly, I did ...
1
vote
1
answer
504
views
Solve non-linear optimization problem with ROI package in R
I want solve a non-linear objective function with two non-linear constraints in R. I have succesfully solved the model in GAMS but because of my general data workflow, I would like to use R instead. ...
2
votes
1
answer
955
views
Fitting data to a Boltzmann sigmoid function, and estimating parameters with a non-linear least squares fitting in R
I have a dataset of 10 subjects, whose muscle response amplitude was measured across 11 different stimulus intensities (states) applied to their muscles. The output curve of the data looks like a ...
0
votes
0
answers
67
views
How to create a crp code for sin function
I want to find the cross recurrence plot for the sin(x) function, with a time delay t that I will input. I do not know the specific functions that will get me to the image I want; it is essentially ...
0
votes
0
answers
96
views
raise TypeError("Argument must be either a string, dict or module but it is: %s" % m)
I am trying to solve a function which I got which is like
v2 = (1 - d) * sp.diff(h1, x) + (d / ep) * sp.diff(w, y) + d * sp.diff(w, x)
I want to convert symbolic expressions to numerical functions ...
2
votes
1
answer
65
views
Non-linear optimisation in Python using GEKKO: maximum weight constraint
I'd like to be able to fix an error in the Python code below relating to "wmax". I'm trying to find a solution of weights (the w[i]) such that all the weights are less than or equal to 2.5.
...
0
votes
1
answer
113
views
Solve nonlinear equation system with parameter in Matlab
How to modify the code if I add parameter c to function
Thank for help
x0 = [0,0];
x = fsolve(@myfunc,x0)
%===================
function F = myfunc(x)
F(1) = 4*c*(c*x(1) - 2)^3 + 2*c*x(2)^2 *(c*x(1)-2);...
1
vote
2
answers
322
views
Pyomo MINLP solver not picking the optimal outcome
I'm using Pyomo to solve an MINLP problem. It seems to run without issue, but the solution it's picking does not seem to be optimal.
The gist of the problem is that I'm trying to optimize a function ...
0
votes
1
answer
50
views
Problems solving nonlinear systems of equations involving trig functions in Python using Sympy
I'm trying to create a program that solves the solutions for an equation of a circle:
This is the code I wrote for it using Sympy. It works for functions like x^2, but I always encounter an error ...
2
votes
1
answer
58
views
Python: Nonlinear optimisation with Gekko
I am getting the following error with the code below:
TypeError: x must be a python list of GEKKO parameters, variables, or expressions
The error seems to relate to the form of the "m.Equation&...
0
votes
1
answer
48
views
OpenMDAO Newton solver errors handling in DOE
With OpenMDAO 3.25, I am trying to run the om.DOEDriver with om.UniformGenerator on a model which contains a group with a Newton NL solver with the linear DirectSolver solver, similar to that ...
3
votes
1
answer
80
views
Python: Nonlinear optimisation with restrictions (Gekko?)
I'd like to be able to solve the following problem in Python:
Given observed data x(1)....x(n) and a known fixed target 'B' and tolerance 'E', solve for parameters a0, a1, & a2, which minimise:
...
0
votes
1
answer
125
views
Inverse of Non-Linear Equations - MatLab
I have been trying without success to figure out how to invert the two equations shown below. As you can see, the equations are fairly complex nonlinear equation expressing R and T (reflection and ...
0
votes
0
answers
53
views
Linear Non-Linear Modeling
So I've included code for 1 question for reference below.
Question 3 asks me to assume that the linear predictor, takes the values between −5 and 5 equally spaced by 0.01. If the link function is ...
0
votes
1
answer
904
views
How to run an exponential decay mixed model?
I am not familiar with nonlinear regression and would appreciate some help with running an exponential decay model in R. Please see the graph for how the data looks like. My hunch is that an ...
2
votes
1
answer
181
views
R: Interpolate x values given y and z in a matrix using interp2 and fzero
Brief summary
I have a matrix of values representing a topological surface. I'm trying to calculate the x values for an exact contour z for each column y.
In Depth
I'm fitting experimental data to a 3-...
1
vote
0
answers
90
views
How to solve functional equation?
I have functional equation
B(2z^4 + 4z^6 + 9z^8 + 20z^{10} + 44z^{12} + 96z^{14}) = (B(z))^4
I try to solve it using Maxima CAS :
(%i2) e: B(2*z^4 + 4*z^6 + 9*z^8 + 20*z^10 + 44*z^12 + 96*z^14) = (...
0
votes
0
answers
219
views
Solving Nonlinear system of equations in Mathematica (wolfram)
I'm Trying to solve a System of equations in Mathmatica with the Function of NSolve
The Code should represent a Mass Balance of A factory, in one of the Flows im trying to change the Conc. of the ...
1
vote
1
answer
104
views
Non-linear least squares in R: Error in eval(predvars, data, env) : object not found
I am trying to fit a gnls function in R and throws me an error that says:
Error in eval(predvars, data, env) : object A not found Not sure where I am going wrong.
set.seed(111)
y.size <- rnorm(100,...
1
vote
1
answer
2k
views
How can I get Isocontour's xy coordinates for contour plot?
I am trying to get isosurface's x-y coordinates from 3D plot. Here is my attempt;
import matplotlib.pyplot as plt
from numpy import pi, cos, sin, linspace, meshgrid
x = linspace(0,50,1000)
y = ...
0
votes
2
answers
183
views
Speed up solving time of this function
This function is working fine but it takes too much time to solve. Please suggest me how to improve the solving time.
from sympy.solvers import solve
from sympy import Symbol
QD = 25.45
CDI = 0.65
...
1
vote
1
answer
1k
views
How to fit non-linear function to data in ggplot2 using maximum likelihood model in R?
The data set (x.test, y.test) is an exponential fit. I'm trying to fit a custom non-linear function and attached is the code. The regular points plot just fine but I'm unable to get the fit line to ...
1
vote
0
answers
93
views
Estimating 15 parameters with the least square method for a non-linear objective function MATLAB
I want to estimate the parameters x1-x15 with the least square method in MATLAB. My objective function is
sum((Pot-Potcap).^2)
Pot = x(14)*exp(-(t*log(x(1)*x(15) + 1))/x(15)) + x(14)*(exp(-(t*log(x(3)*...
0
votes
1
answer
381
views
Balancing a System of Non-Linear equations for Chemical Reactions
I am trying to compute the final composition and temperature of a mixture of syn-gas and air. They enter in at 300 K and 600 K respectively. The syn-gas is a mixture of CO and H2 the proportions of ...
0
votes
0
answers
125
views
how to dynamically instantiate a new NonlinearObjectiveFunction through a string with Accord.net
i am working on project that it is implementing a one of the non linear optimization algorithm
and to achieve that i chose to work with c# and wpf as platform
i found how to implement the algorithm ...
2
votes
2
answers
272
views
How to verify in Fortran whether an iterative formula of a non-linear system will converge
How to verify in Fortran whether an iterative formula of a non-linear system will converge to the root near (x,y)?
It was easy for a programming language which support symbolic computations. But how ...
0
votes
0
answers
102
views
Correctly Writing A Quadratic Differential Equation Solver in Python
I would like to plot a particle's path through phase space using only the Hamiltonian
E = p**2 + U(x), where p=dx/dt. And so for a constant energy E (given by initial values x0, p0), I can restrict ...
1
vote
0
answers
768
views
Solve a system of nonlinear equations with constraints on the variables
I am trying to solve nine nonlinear equations with nine variables using fsolve in python. But I don't know how to set the constraints to the variables. Besides, the iteration of fsolve is not making ...
1
vote
2
answers
229
views
How can I solve the optimal solution of a system of overdetermined nonlinear equations using R
library(BB)
library(nleqslv)
library(reprex)
library(ktsolve)
yfunc<-function(x){
y<-vector()
y[1]<-a+b*sin((238.61/365)+c)-(39393*0.00341802+149-273.15)
y[2]<-a+b*sin((1821.2/...
0
votes
0
answers
231
views
Solving Non-Linear Equation in Python
I have two equations with two unknowns but they seem to be quite non-linear. They are of the form,
C1 = (A1) * ((10)^(B1 * x)) * ((D1 * y)^(E1))
C2 = (A2) * ((10)^(B2 * x)) * ((D2 * y)^(E2))
I would ...
0
votes
1
answer
168
views
inflection point for 3-parameter weibull in R?
The drc package in R contains self-starting functions to fit a 3-parameter Weibull model to data. The package gives 2 parameterizations of the 3-parameter weibull (https://cran.r-project.org/web/...
0
votes
1
answer
1k
views
Root finding for nonlinear vector functions in python: how can I place bounds on my variables? [duplicate]
For root finding of scalar functions,scipy.optimize.root_scalar provides a very useful bracket argument that I can use to set the interval bracketing my root to ensure the root that I find is the one ...
1
vote
1
answer
136
views
m functions of n variables in R
Suppose I want to construct the following function:
f <- function(beta) c(y[1]*beta[1]+z[1]*1/beta[2],
y[2]*beta[1]+z[2]*1/beta[2],
: : : :
...
0
votes
1
answer
56
views
Loop in a function
Package for Jacobian matrix
install.packages('pracma')
library('pracma')
Suppose I have the following set of non linear functions
f <- function(beta) c(y[1]*beta[1]+z[1]*1/beta[2],
...
0
votes
1
answer
308
views
Generating a function via for-loop for the Jacobian matrix in R
Suppose I have the following two variables y and z and the variable x
y = 1:10
z = 1:10
Now I would like to create a jacobian of the following function
f <- function(x) c(y[1]*x[1]+z[1]*x[2],
...
2
votes
1
answer
339
views
Generalizing the inputs of the nlsolve function in Julia
This question has already been asked on another platform, but I haven't got an answer yet.
https://discourse.julialang.org/t/generalizing-the-inputs-of-the-nlsolve-function-in-julia/
After an ...
5
votes
1
answer
2k
views
Find zero of a nonlinear equation using Julia
After a process usyng the SymPy in Julia, I generated a system of nonlinear equations. For the sake of simplicity, I am going to put an approximation here for the case of just a non-linear equation. ...
1
vote
2
answers
223
views
Fitting non-linear equation to data using base R package
let say I have below data
Data = structure(list(col1 = c(31, 66, 88, 123, 249, 362, 488, 610,
730, 842), col2 = c(2101.58953918969, 2103.57391509821, 2100.3292541732,
2101.64107993765, 2100....
0
votes
0
answers
456
views
How to calculate non-linear least squares for a custom function in R?
I am trying to run non-linear least squares using a custom function following this example
The data set has a x, predictor y, and groups (a/b). I've only worked with MLLs code previously. I'm having a ...
0
votes
2
answers
2k
views
Negative covariance matrix in Unscented Kalman filter
I want to implement the Unscented Kalman filter(UKF) method for the nonlinear problem; I set all initial values such as initial mean vector and initial covariance matrix. The dimension of the problem ...
1
vote
1
answer
500
views
Solving single non-linear equation involving sum of numpy array with fsolve
I'm trying to solve the following equation:
This non-linear equation comes from summing "k" other equations. Every variable is known here, except m_dot_ev^(T), so this is what I'm trying to ...
1
vote
0
answers
68
views
How it is possible to linearize this equation and to implement it in FreeFEM++ code?
I am contacting you to try to get some answers about a problem related to a non linear problem.
In fact, I tried to linearize the equation so for this I took c1 = c10 + dc1 where c1 is my variable, ...