# Questions tagged [piecewise]

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

305 questions
Filter by
Sorted by
Tagged with
1answer
36 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. ...
1answer
94 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 ...
1answer
29 views

### Extending a piecewise function defined over a limited domain to be periodic over a larger domain

I need to plot the piecewise function $\qquad f(x) = x^2\quad -2 <= x <= 0, \\ \qquad f(x) = 0\qquad 0 <= x <= 1 \\ \qquad f(x) = 1-x\quad 1 <= x <= 3 \\$ as a periodic ...
1answer
558 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: ...
1answer
46 views

2answers
173 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 ...
0answers
55 views

### Piecewise function inside Integrate - Wrong result

I tried to evaluate the following integral: ...
1answer
117 views

### Inaccuracy of Piecewise function? [duplicate]

I have the following issue and can't find a solution so far. ...
1answer
80 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 ...
2answers
64 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 ...
0answers
34 views

### Imposing conditions on argument for a function definition

Suppose that I wish to use "Piecewise" to merge two different interpolating functions (obtained via a NDSolve of some ODE), defined over negative and positive arguments respectively, like: ...
1answer
59 views

### Defining a function with a point of finite discontinuity [closed]

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. ...
1answer
55 views

### Integrating piecewise function in two variables

I want to find (and plot) the integral of a 'smooth' version of the Möbius function MoebiusMu[x]: ...
4answers
245 views

### Continuous non-piecewise equivalent of smoothstep function?

I have a smooth step function given by the piecewise function ...
0answers
83 views

### Slow Plotting of a Piecewise Function

I have stumbled upon an issue that seems very weird to me. I have two Piecewise functions that describe exactly the same curve. The only difference between them is that the first function has two ...
1answer
82 views

### Convert a piecewise definition of a single impulse into an impulse train

NOTE: See update at end of question I have a function smoothstep (based on the derivative of a smoothstep function) that gives a single impulse as follows: ...
2answers
442 views

### Solving Stefan's solidification problem - for the case of 3 regions

This question heavily related to this question, where the case of two PDE's are solved along with a zipping condition that is a function of time. Using the link in the code I have solved this set of ...
1answer
131 views

### How to change colors of 3D parametric plot

I have a 3D iterative plot, where each iteration (1,2,3) is represented by equation of piecewise linear function. I am trying to change the colors of plot, to get for every iteration (piecewise ...
2answers
77 views

### How to plot 3D discontinuous iterative plot?

I am having troubles with plotting this set of data triples={{0, 1, 1}, {9/50, 4/5, 1}}, {{9/50, 4/5, 1}, {3/8, 4/5, 1}}, {{3/8, 58333/100000, 1}, {3/4, 16667/100000, 1}}, {{3/4, 0, 1}, {1, 0, ...
2answers
71 views

### how to get coordinates from a plot of piecewise function?

I am having troubles with finding points from a plot. I have a piecewise linear function given by following inequalities. These inequalities I got from previous calculations where I split two ...
0answers
24 views

### Locating the interval on a piecewise function and integration :

I'm recently learning Mathematica to help me compute some difficult stuff, and let's say I have a piecewise-defined real valued function with a finite number of subpieces. I can index the intervals ...
0answers
49 views

### How to extract envelope for piecewise defined function? [duplicate]

I have a plot generated from an ugly and complex set of piece-wise functions. I'm looking to extract the envelope function from this data set. I've tried a lot of suggestions in other threads, but ...
1answer
62 views

### Using Piecewise to plot a defined function [closed]

I'm trying to Plot this function: Between the interval -0.2 < t < 0.1 but it doesn't work. All i get is a blank graph between my intervals. If you could help me out I'd greatly appreciate it. ...
1answer
40 views

### How to read information from a piecewise function?

I defined a periodic piece wise function y[x_] with some discrete steps with Piecewise command and two lists ...
3answers
501 views

### Solve piecewise function

I have two piecewise function ...
2answers
61 views

### Combine EvenQ and Clip to create a series of pulses

I have a function that produces a single impulse spanning the range [-1,1]: func1 = Cos[Pi*(Clip[x]/2)]^2 I want to create a ...
0answers
56 views

### Using table and piecewise function together

I am trying to define an equation set, in which the function is very similar to a square wave, but instead, it is defined piecewise at each interval. Now I need to evaluate the equation at each ...
1answer
100 views

### How to represent in a 3D graph the set of solutions to this system of inequalities?

I am studying this piecewise function: ...