Questions tagged [discrete]
83 questions
4
votes
1 answer
Modelica and Event generation of Functions
I try to understand when events are generated in Modelica. In the context of functions I noticed behaviour I didn't expect: functions appear to suppress event generation.
I am surprised as this is, to my knowledge, not explicitly stated in the…

user578943
- 85
- 5
3
votes
1 answer
How to use Gekko for trajectory optimization in discrete time
I am trying to use Gekko to optimize (dis)charging of a battery energy storage system. Electricity prices per hour EP, energy production from solar panels PV, and energy demand Dem are considered over the entire horizon (0-24h) to minize total costs…

Robert_RP
- 55
- 5
3
votes
2 answers
Specification of Multinomial model in Tensorflow Probability
I am playing with a mixed multinomial discrete choice model in Tensorflow Probability. The function should take an input of a choice among 3 alternatives. The chosen alternative is specified by CHOSEN (a # observationsx3 tensor). Below is an update…

Jason Hawkins
- 625
- 1
- 9
- 24
2
votes
1 answer
Gekko discrete optimization indexing problem
I have a question regarding this problem. I want to let model search for optimal value of loader, loader_size, truck, truck_size to solve two constraints of total cost and total duration. However, i faced with a problem regarding the cost. Since…

kennnn
- 83
- 3
2
votes
1 answer
Finding optimal solution from discrete array
I wonder if we can limit variable range between a non-interger numbers , but discrete ones.
Let say I have an array of N=[[2.3 ,4.5, 5.8] , [6.4,7.1,4.1]] .
A is a variable array elment of N[0,i] for i<3, which means A = 2.3,4.5,5.8 .
B is a…

kennnn
- 83
- 3
2
votes
1 answer
What is the right way to make a colorbar for discrete data in Plots.jl?
Let's say we have some discrete parameter, according to which we want to make a coloring on the plot using Plots.jl with GR backend. The parameter type (in the example below, it is Int64) clearly indicates that it is discrete, but if we do not take…

Anton Degterev
- 591
- 2
- 12
2
votes
1 answer
xarray discrete scatter plot: specifying legend/colour order
Plotting a discrete xarray DataArray variable in a Dataset with xr.plot.scatter() yields a legend in which the discrete values are ordered arbitrarily, corresponding to unpredictable colour assignment to each level. Would it be possible to specify a…

climatestudent
- 459
- 4
- 13
2
votes
1 answer
Spatial interpolation of discrete points onto x/y coordinate mesh grid in Python
I'm still very new to programming and trying to create a contour plot of alkalinity across Hawaii using Cartopy. I will need to interpolate the point values called MODIFIED_TA against an x-y mesh grid but have not been able to figure out how to do…

Caroline J.
- 27
- 3
2
votes
1 answer
optimize function using positive parameters inputs in R
I have a function which I would like to optimize based on a vector of integers. Essentially, I'm trying to find the maximum value by changing the order of the inputs. See an example below. My data is much larger so I'm wondering if there is a…

jsimpsno
- 448
- 4
- 19
2
votes
0 answers
Matplotlib - place ticks exactly where discrete colors change
I am trying to plot a colorbar that uses a limited number of colors (discrete). The problem is that the colors don't change where the major and minor ticks appear. The issue is worse with a log scale (which is what I need), but also happen with a…

hbarbosa
- 101
- 3
2
votes
1 answer
If a problem A ≤p B, then that B ≤p A, prove or disprove
How to formally prove or disprove that if a problem A ≤p B, then it follows that B ≤p A
I intuitively think this should be disproved, but I'm not sure how to go about it.

ChaiTea
- 65
- 1
- 8
1
vote
1 answer
Is there a function in matlab to calculate higher level of DCT's like DCT-III,IV?
I have recently started working with DCT. I have started with DCT-II, and there is dct() & dct2() in MATLAB that helps in the calculated of 1-D and 2-D DCT-II respectively. I wanted to know if there are some other functions that help in the…

Sahil Sharma
- 17
- 5
1
vote
1 answer
Using python's Gekko in engineering optimal design
I am trying to use Gekko in optimal design of a reinforced concrete building modeled with Abaqus.
*my design variables are the cross sections of the the building's structural system. Every variable of this kind is a set of:
dimensions of…

Amjad_Helwani
- 31
- 1
1
vote
1 answer
python implementation of matlab "d2c" function
I'm trying to convert a discrete transfer function to a continuous one (z to s) in python. It works perfectly fine in Matlab:
>> H = tf([0.0, 0.00011109058274028799, 0.0, 0.0, 0.0, 0.0],[1.0, -4.746477630953663, 9.128106677145524,…

Beginnerlevel
- 11
- 2
1
vote
1 answer
Spacing on x-axis using ggplot2 discrete scale
I've been working with this code for a while but this is the first time I've only had two categories on my x-axis. For some reason, R will not space out the bins and instead bunches them at the beginning. How do I evenly spread them along the…

Olivia Markham
- 13
- 3