# Questions tagged [piecewise]

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

373 questions
Filter by
Sorted by
Tagged with
51 views

47 views

### Piecewise function not evaluating properly

I have a simple Piecewise function that defines a square pulse: ...
54 views

### ParametricNDSolve “delayed time” error message

Issue reported to Wolfram, Inc as a possible bug in Version 12.1; CASE:4554034. When trying to solve a system of delay-differential equations with ParametricNDSolve...
55 views

33 views

### Plotting a piecewise function MRI problem

I have this M.R.I. question, and i need to plot a function with some 'a' and 'b' parameters and 't' as a variable: ...
30 views

### Solving a Piecewise ODE [closed]

I am attempting to solve a piecewise ODE. $y' = \begin{cases} -1 & \text{for$y \geq 0$}\\ 1 & \text{for$y < 0$} \end{cases}, \qquad y(0)=0, \qquad x \in [0,1]$ I have attempted solving ...
21 views

### PiecewiseExpand doesn't work as expected with a recursive function

In an effort to examine this question on Math.SE, I defined the following functions ...
24 views

### Find and indicate the minimum of a piecewise function in the Plot3D diagram

I'm trying to indicate in my Plot3D diagram the minimum level of the dependent variable and the corresponding levels of two independent variables. More specifically,...
53 views

### Piecewise integration not giving continuous result

I'm trying to integrate a piecewise function symbolically and I'm ending up with discontinuities which is surprising since the help mentions that constants are determined to ensure continuity. If I ...
37 views

### Why do Integrate and DSolve/DSolveValue yield such complex expressions for Piecewise functions?

This code uses two different methods for integrating a very simple piecewise function but yields surprisingly complicated integrals: ...
48 views

### Using subscripted symbol affects integration — why?

Below is a sample program that shows that Integrate is giving different results depending on whether I name the variable duration1 or ...
80 views

### Graphing a Fourier Series

First off, I have created the following Fourier series for the below equation/condition: $$f(t) = \begin{cases} 0, & 0<t<1 \\ 1, & 1<t<2 \end{cases}$$ My Fourier Equation for ...
22 views

### Limiting the Domain of a Function

Currently, I am trying to plot (using Mathematica) the following function: $$f(t) = \begin{cases} 0, & 0<t<1 \\ 1, & 1<t<2 \end{cases}$$ And, to try to plot this, I did some ...
56 views

### Plot of Piecewise function is slow

While working on answer for question (here) I found out that the Plot is incredible slow for Piecewise function: Some preparations: ...
40 views

### Bad Integral evaluation for Piecewise function

I have been trying to evaluate this symbolic function: f[ρ_, R_, α_, yp0_, yp_] := R*((ρ - R*Cos[α])^2 + (R*Sin[α])^2 + (yp-yp0)^2)^(-(1/2)); Mathematica can ...
46 views

### Plotting Piecewise function?

I am facing a problem in plotting the Piecewise function. I simplified my problem to take the following form: where \[Sigma][i] are Pauli matrices. My code is: <...
752 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: ...
83 views

### count conditional items in list

I have a list of the form: {1,1, (1 if x>y, -1 if y>=x), -1} I want to count the number of 1's in the list. The output I'm looking for is something of the ...
61 views

### Forcing the fit of a nonlinear piecewise function to be continuous

I am trying to fit some data ...
169 views

### Automatic Piecewise Approximation

I would like to create the following function: It should approximate a function func[x] by piecewise polynomial interpolations, splitting the approximate function ...
6k views

### Integrating a Simple Piecewise Function

If I define f[x_]:=If[x<0,-1,1] and then integrate,say Integrate[f[x],{x,-3,7}] I get what I expect, namely 4. But ...
678 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 ...
51 views

### find intersections of 2 Piecewise Functions in ImplicitRegion

How do I combine this two parts of a Piecewise functions? I have trouble join this with || ...
36 views

### Can someone tell me what is wrong with my code? [closed]

The code I am using to make my plot is: DiscretePlot[ Piecewise[{{1/((-2)^{x + 1}), x <= 3}, {1/32, x >= 4}}], {x, 0, 10}] Also, how do I change to color ...
39 views

### Need help plotting on Mathematica simple piecewise wave function from quantum physics (Quantum Physics, Griffiths, 2.7) [closed]

On Mathematica need to plot an initial wave function defined as... Psi(x,0) = Ax when 0 <= x <= a/2 Psi(x,0) = A(a - x) when a/2 <= x <= a Here is my attempted code... ...