The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
30 views

Integral for piecewise function inconsistent with the usual way

I have the following piecewise function: ...
1
vote
1answer
39 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
122 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
39 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 ...
1
vote
1answer
78 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
37 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
43 views

Piecewise functions Integration with symbol

I want to integrate one piecewise functions as following, ...
3
votes
1answer
91 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
41 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
146 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
116 views

Understanding a piecewise function generated by Mathematica

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

PolarPlot works, ParametricPlot doesn't

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
116 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
104 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
67 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
44 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
2answers
221 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
271 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
45 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
99 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
294 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
411 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
64 views

Inaccuracy of Piecewise function? [duplicate]

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

Definite Integral, Piecewise, Error

I am trying to evaluate the following: ...
4
votes
1answer
360 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
168 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
285 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
44 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
193 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
183 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
402 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
105 views

Define customised distribution with discontinuous CDF

I have the following CDF: ...
2
votes
1answer
350 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
260 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
152 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
347 views

Using units and piecewise functions in Integrate

For simple cases, Quantities appear to be handled well by Integrate: ...
2
votes
2answers
257 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
120 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
301 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
90 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 ...