The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
1answer
103 views

(Very) ill-behaved Piecewise Plot

I am interested in defining a function (with arguments: a symbol for a variable and a list of 6 points) that represents a quadratic interpolating spline of the points. Here is my attempt ...
2
votes
3answers
93 views

Why do plot functions fail to plot expressions containing piecewise functions? [closed]

Why do both of the following plots appear empty in Mathematica? I tried evaluating the functions $\chi_+$ and $\chi_-$ at various points and it seems valid, so why does Mathematica not plot them? ...
2
votes
1answer
66 views

Plotting a piecewise function with strange subdomains

I have a function, which analityc expression is $C=2*max[b-c,0]$(you can see the expressions of b and c down). Then I have to considerer $q_\pm=\frac{(1\pm \sqrt{ (1-C^2)})}{2}$ and then to plot ...
2
votes
0answers
33 views

Data paste in piecewise table

How can I paste data copied from several lines into a piecewise table, without pasting it in a single cell?
4
votes
2answers
101 views

Piecewise Polynomial Interpolation

Given some data pairs $(x_i,y_i)$, with $i=0,...,m$, and a degree $r$, I wish to build a piecewise polynomial function to interpolate these data. That interpolation should be continuous, and, on every ...
1
vote
2answers
243 views

Plotting 3D piecewise function with distinct colors

I want to draw the following picture in Mathematica as shown below with distinct color for each section.
1
vote
1answer
42 views

PiecewiseExpand doesn't take all kind of assumptions

Running PiecewiseExpand[expr, assum] does not work with all kind of assumptions. For example, the following line will not split the expression with absolute values in the chambers, considering m1=m2. ...
2
votes
1answer
71 views

Piecewise conditions with a parametric PDE

I'm using ParametricNDsolve to check best fit of a model (function Eb1) with some data, and I have four free parameters I want to test. I can easily construct a Parametric solution between the two ...
0
votes
2answers
126 views

3D Plotting with PieceWise function

Im trying to plot the following function: $f(x,y)$ = $\left\{\begin{matrix} (x+y) & (x,y) \in T \\ (x+y)^2 & (x,y) \notin T \end{matrix}\right.$ where $T= \{ y\leq -x+1, x\geq 0, y\geq ...
6
votes
2answers
388 views

How to plot this function?

I'd like to plot the function $f$ in this answer http://math.stackexchange.com/a/788818/66096 Let $h(x) = \begin{cases} e^{ -\frac{1}{1 - (1-2x)^2}} & \mbox{ for } 0<x < 1\\ 0 & ...
1
vote
1answer
59 views

Inaccuracy of Piecewise function? [duplicate]

I have the following issue and can't find a solution so far. ...
0
votes
1answer
64 views

Define function that goes from one point to another parametrically

I have two points p1 and p2, and I want to get the parametric equation of a linear function that passes through those, but ranging from one point to another. For example, if I have 2 points {0,0} and ...
0
votes
1answer
44 views

Definite Integral, Piecewise, Error

I am trying to evaluate the following: ...
4
votes
1answer
222 views

Fitting piecewise functions

I have several large data sets which follow the following pattern: A position is measured, a force is applied until a new equilibrium is found. I'd like to find a fit for the position, at least at the ...
0
votes
1answer
97 views

Manipulating a piecewise function

A while ago I posted a question regarding differential equations. It was supposed to model heat transfer. We've refined our model a bit (using numerical methods now). Our code now looks like this: ...
2
votes
1answer
185 views

Trying to solve a differential equation with a piecewise initial condition

I am trying to solve $$u_t=\frac{1}{4}u_{xx}$$ $-\infty<x<\infty,\: t>0$ With the initial condition $u(x,0)=\phi(x)$ where $$ \phi(x)= \left\{ \begin{array}{lr} 1 & ...
0
votes
0answers
39 views

How does NIntegrate evaluate a piecewise range of x,y?

Could someone explain to me how Mathematica evaluates the following integration. ...
0
votes
1answer
131 views

Nonlinear fit with piecewise functions

I have an ensemble of data points $(x_i,y_i)$ and I need to fit them according to $y=F(a,b,x)$ if $x \leq x_{ref}$ and $y=G(c,d,x)$ if $x \geq x_{ref}$. The parameters I need to adjust are then ...
0
votes
2answers
95 views

Defining Piecewise Functions in Modules

In short, my question is the same as my previous one except that everything is now wrapped up in a module. The relevant code I'm working with is: ...
2
votes
4answers
289 views

How to build a funcion that returns a piecewise function

I dont know how to go ahead with this The problem statement is "Make a piecewise linear function maker that accepts lists of points as input and has a piecewise linear function as the output". Lets ...
4
votes
1answer
88 views

Define customised distribution with discontinuous CDF

I have the following CDF: ...
2
votes
1answer
227 views

Defining Piecewise Functions [duplicate]

I'm having trouble defining piecewise functions. What I have so far is a function that outputs something in a suitable format for Piecewise: ...
4
votes
3answers
248 views

Creating a function with integral zeroes of the 0th, 1st, and 2nd derivatives

I would like to be able to randomly generate functions, each of which satisfies $f : [-10, 10] \rightarrow [-10, 10]$ All the zeroes, critical points, and inflection points have an integral ...
1
vote
2answers
139 views

Add Piecewise functions expanding domains

I want to reproduce these plots for further development in Mathematica: To do so I defined the functions A and B as following ...
4
votes
2answers
270 views

Using units and piecewise functions in Integrate

For simple cases, Quantities appear to be handled well by Integrate: ...
2
votes
2answers
209 views

Colors for multiple piecewise functions

I have the following $3$ piecewise functions, and I would like that f1, f2 and f3 have $3$ ...
2
votes
2answers
96 views

How to select a certain portion of a piecewise function?

For example, if I have Piecewise[{{x^2, x < 0}, {x, x > 0}}], how do I select only the function that is for x < 0? I ...
8
votes
2answers
225 views

Is there a way to symbolically invert a piecewise function

I have a piecewise function that is continuous and strictly monotonic, like this: f[t_] = Piecewise[{{t/4, t < 0}, {t/2, t < 3}, {3/2 + (t - 3)*3, True}}] ...
6
votes
0answers
81 views

Slow NIntegrate over complicated domains (sometimes)

Overview I have a very large matrix I need to calculate where each element requires the integration of a product of two functions over some complicated domain. I would like to find a set of options ...