The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
3answers
70 views

Fill an array, symmetric with respect to its centre

I want to create an array that must be symmetric with respect to the centre of it, as in the following example: 0 1 2 3 4 3 2 1 but, instead of having such ...
0
votes
0answers
16 views

Filling Piecewise Function leaves gaps [duplicate]

When I use the fill feature to shade the area between the curve and the x-axis, there is no fill when x=2. I don't understand how this is possible since the function is defined there. Any help to fill ...
0
votes
0answers
46 views

How to make Piecewise continuous [duplicate]

I have a function defined by its slope in a continuous sequence of intervals, e.g. ...
1
vote
1answer
67 views

How to draw dots at beginning and end of range when plotting [duplicate]

I'm trying to plot a Piecewise function which should look like this: How can I have similiar dots (filled or empty) at beginning and end of range? ...
0
votes
2answers
77 views

Using parts of piecewise function

I define: f[x_] := Piecewise[{{5, 0 <= x < 10}, {g[x], 10 <= x < 15}, {h[x], x > 15}}] Then I try to solve ODE: ...
1
vote
1answer
66 views

Piecewise ColorFunction for Plot3D

I want to make a 3D plot where the ColorFunction is different depending on whether the function value is positive or negative. I know how to do the following: ...
0
votes
2answers
91 views

Convolution of a piecewise function

I want to find the convolute the the functions in the Convolve command ...
1
vote
1answer
48 views

Piecewise function and integral function

Given a piecewise function f[t_]:=Piecewise[{{Exp[-1/t^2],t>0},{0,x<=0}}], I can define another function like this: ...
3
votes
1answer
70 views

How to make the result of Piecewise be a closed interval?

Description This question comes from two questions. Namely Q1 and Q2 The defintion of B-Spline basis function as shown below: Let $\vec{U}=\{u_0,u_1,\ldots,u_m\}$ a nondecreasing sequence of real ...
2
votes
2answers
141 views

Plotting boundary of piecewise function in ContourPlot

I am trying to do a ContourPlot of the following function: ...
5
votes
4answers
276 views

Plotting piecewise functions

I have a list of N functions called functionList. N can be any number. Also, I have a list ...
0
votes
1answer
52 views

Integral for piecewise function inconsistent with the usual way

I have the following piecewise function: ...
1
vote
1answer
50 views

Sum of two Piecewise functions give wrong vector

I would like to calculate the normal at a certain point of a parabola. The parabola is defined only on a certain area according to a Piecewise function. Afterwards ...
4
votes
2answers
225 views

Solving a discontinuous differential-algebraic equation system for plasticity behaviour

I need to solve a discontinuous equation which is typical in theory of plasticity. For a simple case I get the following equation system (reformulated for numerical implementation): $s(t) = ...
1
vote
1answer
48 views

Using If statement for more than two cases [closed]

I want to use the If statement for three different scenario. Can someone help me out? Pls also indicate if there is a better function to do that. This is an example ...
2
votes
1answer
171 views

Piecewise smooth rectangle pulse

I am wondering how to create a single rectangle pulse with nonlinear riding and falling edges on both sides. I don't know whether it is better to do it piecewise or to mathematically transform the ...
0
votes
1answer
48 views

Finding a solution when there are two piecewise functions at play

The goal is to mathematically figure out where is the point when the both of the diagrams are the same distance to the Y-axis. The solution to such a problem can be obtain quite easily by just ...
0
votes
0answers
54 views

Piecewise functions Integration with symbol

I want to integrate one piecewise functions as following, ...
3
votes
1answer
223 views

Define and plot a piecewise function with parameters [closed]

I have this function , but i do not know how to define it in mathematica \begin{equation} f_t(x)=% \begin{cases} i& \text{$\frac{1}{1+i}<|x-t|\le \frac{1}{i}$} \\ ...
0
votes
0answers
47 views

Transform NMinimze into LinearProgramming formulation

I have the following maximization problem that I currently try to solve with Minimize/NMinimize. Unfortunately, this kind of solution method takes really long for large systems of equations and ...
4
votes
1answer
338 views

Integrate over piecewise function defined using /;

f[x_] := x /; x<0 f[x_] := x^2 /; x>=0 Integrate[f[x],{x,-1,1}] The above does not work (Mathematica returns it unevaluated), but the below does. ...
1
vote
1answer
135 views

Understanding a piecewise function generated by Mathematica

After some simplifications I was eventually get the following piecewise function. ...
0
votes
1answer
115 views

PolarPlot works, ParametricPlot doesn't [on hold]

Am new to Mathematica, so if this question has been asked already, apologies. Have a (polar) spline function and Mathematica did a fine job of calculating from my inputs and giving me the piecewise ...
2
votes
1answer
126 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
119 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
72 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
52 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?
5
votes
3answers
483 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
290 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
49 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
123 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 ...
1
vote
2answers
457 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 ...
7
votes
2answers
425 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
70 views

Inaccuracy of Piecewise function? [duplicate]

I have the following issue and can't find a solution so far. ...
0
votes
1answer
82 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
81 views

Definite Integral, Piecewise, Error

I am trying to evaluate the following: ...
3
votes
2answers
69 views

Mathematica: Extract the piece that contains x=0 from within a piecewise function

In mathematica, I have a piecewise function similar to: Piecewise[{ {x^2 + 2*x - 4, 0 <= x <= 1/4}, {0, true} }] I don't ...
4
votes
1answer
483 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
261 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
2answers
459 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
1answer
221 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
237 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: ...
3
votes
4answers
457 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
113 views

Define customised distribution with discontinuous CDF

I have the following CDF: ...
2
votes
1answer
433 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
292 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
166 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
1answer
476 views

Why does piecewise plot have a discontinuity when the function, first and second derivatives are equal?

There were some related questions to this one, but in this case we have the function value, the first derivative and the second derivative all equal (that was actually the problem I was solving). We ...
4
votes
2answers
391 views

Using units and piecewise functions in Integrate

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

Colors for multiple piecewise functions

I have the following $3$ piecewise functions, and I would like that f1, f2 and f3 have $3$ ...