378 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
0
answers
67
views
Incorrect PieceWise result of integration in Sympy
Result of integrating a function
x,z = symbols('x z', real=True); x,z
px,pz = symbols('p_x p_z'); px,pz
xxe = exp( pz*z + px*x ); xxe
xxe.integrate(z)
in second case of PieceWise doesn't include the ...
0
votes
1
answer
44
views
Trying to plot a picewise-defined function in Python
Just trying to plot a piecewise defined function in python but having trouble with an error.
"The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()". I ...
-1
votes
1
answer
65
views
Problems with pyomo.enivron.piecewise - TypeError: Cannot apply a Set operator to an indexed Var component
I'm programming a optimization in pyomo.environ for timeseries. Now I have the need for using piecewise function. Using the
pyomo.environ.Piecewise(...)
I get the error
TypeError: Cannot apply a Set ...
0
votes
0
answers
33
views
Need help for using davies.test in segmented package for segmented.default
I am having an issue with the segmented package in R. The issue is when I use the davies.test and segmented.default. The code I am working with is as follows:
library(segmented)
library(survey)
data(...
0
votes
0
answers
57
views
What is the problem in this matlab code for Laplace Transform
I have been trying to visualize various Mathematical functions and have been using MATLAB for it. While writing code for this Laplace Transform of periodic function,
The function is;
f(t) = sin(w*t) ...
0
votes
1
answer
114
views
Can you add and/or multiply splines as new splines in SciPy?
I am using Scipy to construct cubic splines, and I need to add and multiply the outputs of the CubicSpline objects. I am wondering whether it is possible to create new splines that give the added and ...
0
votes
1
answer
221
views
Combining piecewise functions with sympy
I have a collection of functions defined using Piecewise from the sympy library in python. They have various different expressions and conditions under which these expressions hold. How can I, for ...
1
vote
1
answer
1k
views
Piecewise functions with sympy: how to define function only for certain input values?
I'm experimenting with Piecewise functions with sympy, and have found that it doesn't like it when I give pairs of expressions and conditions only for certain intervals. For example, when I type the ...
1
vote
1
answer
136
views
How to update piecewise functions with sympy
I have a piecewise-defined function in the sense of the Piecewise class from sympy, and want to be able to manipulate the expressions and conditions within it to form new piecewise functions. For ...
0
votes
0
answers
147
views
How to plot piecewise constant function in python
I am trying to plot a uniform distribution having x and y values.
So the function looks like in this picture
I need to plot this piecewise function in python, so I have tried to do it like shown below:...
0
votes
1
answer
64
views
In CPLEX, piecewise-based stepwise example result
I'm a student studying optimization using CPLEX.
I created a simple stepwise example, but I have some doubts about the results.
dvar float x;
dvar float y;
dexpr float z= piecewise {0->0; 10->0;...
1
vote
1
answer
347
views
How does Gurobi handle the Piecewise Linear constraints inside its core program?
I am using gurobi to solve a Mixed Integer Linear Programming problem. Well, to be precise, the model is linear except a large number of piecewise linear constraints, which I know can be linearized ...
0
votes
1
answer
159
views
Using the piecewise function in the objective function of the IBM CPLEX python API
I can't find the piecewise attributes when using Cplex in Python.
I know with docplex this can be done for example:
from docplex.mp.model import Model
mdl = Model(name='')
f=mdl.piecewise()
Is ...
0
votes
0
answers
42
views
Creating a piecewise function that recurs indefinitely with a constant that needs to be solved each switch
Okay, I know the title is a mouthful, but it is easier to express with functions.
I need these functions to repeat for t up to very large numbers (i.e. t = 36,000,000) and each function needs to be ...
1
vote
1
answer
182
views
Error when specifying the directionality of a claim for a d-separation test [piecewiseSEM + glmmTMB paths]. Is this a bug or am I missing something?
I'm trying to run a SEM analysis with count data.
I'm using piecewiseSEM package (2.30) with paths fit via glmmTMB (1.1.8-9000).
Based on previous tests, the fit of piecewiseSEM models using glmmTMB ...