# Questions tagged [piecewise]

Questions about the Piecewise function, which is represented by different expressions for different ranges of values of its independent variable.

315 questions
Filter by
Sorted by
Tagged with
636 views

### Fourier Transform plot of a piecewise function

I'm working with financial data. I used "Find Formula" to find an approximate function and then I applied FourierTransform to it. Here are the function and the Fourier Transform: ...
32 views

### Interpolation of a “bit by bit” Function

I am facing a problem with integrating a function. I have to integrate the function "bit by bit". This is the smallest working example that shows the problem: ...
54 views

### Integrating a function “bit by bit”

I am trying to integrate a function. But for this task I need to do it "bit by bit". I created a working example that shows the problem. ...
47 views

### How to choose model parameters using Piecewise function

The following code (developed by m_goldberg) works as expected. The model parameters can be selected by using Button, being ...
571 views

### Transform Piecewise[] into sum of indicators

I'm interested in transforming a piecewise defined function into a sum of indicator functions, ultimately with the aim to be better able to integrate them. As an example I would like to transform the ...
128 views

### Different colours for different sectors of piecewise function

I have some lines of code that generate numerical solutions to equations. Then I want to combine two of these in a piecewise function. The way I did it is the following -lf1[r] and lf4[r] are the ...
1k views

41 views

### Having trouble when using a piecewise function

I am trying to define a function where H1[x_]= a previously derived value if 0 < x <100 and H1[x_]=x if x>100 so I have used the following piecewise function: H1[x_]:=Piecewise[{{Evaluate[y[x] /....
107 views

### How to set up a Fourier transform?

I am having trouble figuring out how to set up the Fourier transform to: ...
71 views

### Extending periodic piecewise continuous function

I need to plot the piecewise function $$f(x) = \left\{ \begin{array}{r} x^2, & -2 \leq x \leq 0, \\ 0, & 0 < x \leq 1, \\ 1 - x, & 1 < x \leq 3. \\ \end{array} \right.$$ as a ...
20 views

### Problem with PiecewiseExpand[Max[ ]]

I have these functions: By running this command: FullSimplify[PiecewiseExpand[Max[a, b , c, x, y, z]], 9 <= \[Beta] <= 11] I obtain: However I think ...
53 views

### Maximization of a a PiecewiseExpand funcion

I have the following 3 piecewise functions and their upper envelope. ...
48 views

### Find the intervals where a piecewise is maximum

I have the following 3 piecewise functions and I would like to have the threshold of the upper envelope. ...
109 views

### Converting Piecewise function to C code

I'm trying to convert a function to C Code f = D[Piecewise[{{x^2, -10 < x < 0}, {x, x > 0}}], x] I decided to scan through conditions and corresponding ...
53 views

285 views

### Fourier series of an arbitrary periodic piecewise function

Let's take a switch function as an example: $u(t)= \begin{cases} 1, & \text{$0<t<dT_s$} \\ 0, & \text{$dT_s<t<T_s$} \end{cases}$ How can I get Fourier series of it in ...
57 views

### Piecewise function inside Integrate - Wrong result

I tried to evaluate the following integral: ...
119 views

### Inaccuracy of Piecewise function? [duplicate]

I have the following issue and can't find a solution so far. ...
93 views

### Fast and Listable Piecewise function

I am writing a simulation where I have an array with ten columns and on the order of millions of rows, for which I need to iterate on the order of ten thousand times, making computation time a major ...
68 views

### How can I make a NumberLineLogPlot'?

I have a piecewise function that is defined in logarithmic intervals, i.e., the different pieces are defined on ...
I wrote the code for the function $T$ defined on $[0,1]$ by $T(x)=\frac{x+2}{3}$ if $x\neq\frac{1}{2}$ and $T(\frac{1}{2})=1$ as follows. ...