Questions tagged [discontinuity]

Tag for issues caused by discontinuity (e.g. Boole, Piecewise, UnitStep, If, etc) in arithmetic function.

Filter by
Sorted by
Tagged with
0
votes
0answers
33 views

Exiting CrossSlidingDiscontinuity in NDSolve to follow equilibrium curve

I am trying to figure out how to get the solution curve to an NDSolve to slide along once it reaches a boundary and then to exit the ...
2
votes
1answer
44 views

Why does HeavisideTheta not have an implicit piecewise expansion?

The Heaviside step function implicitly expands to a piecewise function: UnitStep[t - 3] // PiecewiseExpand $$ \begin{cases} 1 & t\geq 3 \\ 0 & \text{...
1
vote
1answer
64 views

Computing limits from the left and right and getting the same answer which isn't correct

When I use the following code: ...
8
votes
1answer
239 views

Mathematica is unable to compute the derivative of the function $\frac{\sin^2(x)}x$

Consider the function $$f: \mathbb R\to\mathbb R, x\mapsto\begin{cases}\frac{\sin^2(x)}x, & x\neq 0, \\ 0, & x=0.\end{cases}$$ It is clear that $f\in\mathcal C^1(\mathbb R)$ and that $$f'(x)...
0
votes
0answers
51 views

Coupled nonlinear differential system with discontinuous functions which values are given by list elements, boundary conditions, NDSolve

I am very new to mathematica, I have googled my problem in vain, hope you can help me. I am currently trying to solve a non linear system of two coupled differential equations given by (41) and (42). ...
16
votes
4answers
498 views

How to model diffusion through a membrane?

This is a follow-up on How to handle discontinuity in diffusion coefficient? Consider diffusion of $u(t,x)$ on the domain $x \in [0,2]$ with some simple boundary conditions such as $u(0) = 2, u(2) = ...
8
votes
1answer
176 views

How to handle discontinuity in diffusion coefficient?

I am looking to solve the diffusion equation with a discontinuous jump in the diffusion coefficient. In 1D, the diffusion equation for $u(t,x)$ is: $$ \partial_t u = \partial_x (D \partial_x u), $$ ...
3
votes
2answers
79 views
0
votes
0answers
27 views

Problem when integrating a discontinuous function

I have this simple code: ...
1
vote
1answer
33 views

Problem with Exclusions when Floor is used

...
1
vote
2answers
70 views

Plotting only one piece of an implicit 3d surface (the one value of the order parameter wich minimizes some free energy function)

I would like to plot a graphic of spontaneous magnetization vs T vs h for a Curie Weiss Model. The equation for stationary ...
6
votes
1answer
239 views

Strange result for sum $\sum _{k=1}^{\infty } \frac{\sin (k (k-1))}{k}$

In this sum over $k$ Sum[Sin[k (k - 1)]/k, {k, 1, ∞}] the result still containes the summation index $k$. ...
1
vote
1answer
162 views

Repeated convergence test failure and why?

i have assigned all the values and the ODE assigned is as this ...
1
vote
1answer
82 views

Strange results from NDSolve after using a smooth (Tanh) function to approximate a discontinuous (jump) event

I am solving a system of ODE which contains a discontinuous ode (the equation v[t]== ...in the following code and it means that my ...
4
votes
3answers
237 views

NDSolve will try solving the system as differential-algebraic equations but it didn't get the solution

Please help me deal with this kind of question about ODEs. My codes are as follows ...
3
votes
3answers
61 views

Dots at points of discontinuity

So, I got this code: Plot[Piecewise[{{3, x <= 0}, {x^2 + 1, x > 0}}], {x, -2, 2}, PlotStyle -> {Purple}, Axes -> False, Frame -> True] and I ...
0
votes
0answers
96 views

How can I get continous plot of ArcTan over all quadrants?

Scope: My calculation is an element in the optimization of a mechanism. The geometry is given by following equations. To get angles β and γ without using the inverse function ...
4
votes
3answers
391 views

A discontinuity in an integral

I have a function which I'm trying to integrate, which is perfectly smooth and Mathematica sees it as well defined everywhere in the region over which I'm integrating it. The function is: ...
5
votes
1answer
124 views

Problem with using NDSolve on wave PDE on string

I am trying to verify my hand solution for wave PDE in 1D, on a string. The solution I get from NDSolve does not match the analytical solution. This is a string, ...
3
votes
1answer
78 views

Piecewise function not evaluating in NDSolve

Perhaps it's something obvious, but why does this simple piecewise function (as well as other conditionals) not evaluate in NDSolve: ...
6
votes
2answers
215 views

Ndsolve problem with Sign (friction)

In a very simple model I consider the motion of a body with frictional force. ...
11
votes
3answers
773 views

How to set interface conditions for optical waveguide in NDEigensystem?

I have been working on waveguide mode analysis using FEM in Mathematica for a week, but I haven't succeeded until now. The optical fiber-like waveguide is featured with different refractive index in ...
0
votes
1answer
87 views

NDSolve gives unexpected results when using the method of lines

I've been trying to solve the following PDE using the NDSolve function but it seems something is not working properly. The PDE is a the heat equation on polar coordinates and assuming angular simmetry:...
1
vote
0answers
46 views

Discontinuities in taking the roots of a complex function

I have the following functions e1, e2, and e3 which consists of the functions ...
5
votes
1answer
175 views

NDSolve with piecewise boundary conditions

I am trying to solve two simultaneous partial differential equation for $P[x,t]$ and $V[x,t]$. I have a piecewise boundary condition for $V[L,t]$. When using that piecewise condition, I get the error ...
5
votes
2answers
303 views

Heat equation with variable conductivity

Let us consider the (very simple) problem $\qquad \partial_x[k(x)\,\partial_xu]=0,\quad x\in [0,1]$ $\qquad u(0)=0,\ u(1)=1,$ with $l\in(0,1)$ $\qquad k(x)=\left\{\begin{array}{l}k_1^{},x<l\\k_2^...
5
votes
0answers
81 views

Evaluation of Mod of InterpolatingFunction prevents discontinuity processing by Plot

While trying out @MichaelSeifert's answer to Eliminating Discontinuities When Using Mod with NDSolve and Plot for Oscillators, I came across this odd behavior. Depending on how an ...
2
votes
1answer
85 views

Eliminating Discontinuities When Using Mod with NDSolve and Plot for Oscillators

I have found similar questions to mine, but dealing with piecewise and parametric plots instead and unfortunately the answers don't seem to extend to my case. I have a solution from ...
0
votes
1answer
65 views

ContourPlot showing breaks in contours

I'm trying find graphically the solutions of the intersection of the following functions. ...
0
votes
1answer
200 views

Finding the discontinuities of a function

I have a list of data and I want to find the discontinuities in the plot of them but I don't want to use interpolation because it is not that exact that it should be. is there any other way? The ...
0
votes
1answer
62 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. ...
0
votes
2answers
115 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, ...
6
votes
2answers
187 views

Finding a removable singularity

I have more complex functions than this, but say I just have: f[x_]:=(x-a)/(x-2) The function is not defined for x==2. I ...
2
votes
2answers
192 views

Solving an ODE with a sign/step function which depends on the time derivative

I'm trying to solve a set of ODEs with a Heaviside step function which depends on the sign of the derivative of the function. This is a simplifying example of what I'm trying to do ...
5
votes
2answers
151 views

Using NDSolve with conditional expression

I am trying to solve the 2nd order ODE for a harmonic oscillator under the influence of a harmonic restoring force, a sliding friction force, and a static friction force. My equations are below: $$ x'...
3
votes
1answer
94 views

WhenEvent - energy conservation not valid [closed]

I would like to simulate the following conservative system, with purely elastic impacts (coefficient of restitution is 1). Applying the WhenEvents the energy of the system is not conserved. How can I ...
6
votes
1answer
304 views

The rectangular region composed of two triangular regions contains a pde connecting the bc of the first and the second kind

I'm going to solve the Laplacian equation of the electrostatic field, which consists of two triangular regions, a rectangular region, a square, and on the intersection of the two regions of $$y=x$$, ...
2
votes
1answer
35 views

Summations with power of DiscreteDelta

Expression Sum[DiscreteDelta[a - 1]^2, {a, -∞, ∞}] evaluates to 1, as expected, but Sum[DiscreteDelta[a - b]^2, {a, -∞, ∞}] does not converge, according to ...
2
votes
0answers
59 views

How to express continuity assumption for Integrate?

I am wondering if it is possible, and how if so, to express function continuity in the assumptions for the definite form of Integrate. First of all, while ...
4
votes
2answers
354 views

Problem in sharpness of Heaviside Function

The Heaviside function is not sharp, Do not know why? ...
1
vote
0answers
103 views

Saturation function in Mathematica [duplicate]

In Simulink, there is a function called Saturation: Is there function like that in Mathematica? If yes, what is it called?
0
votes
1answer
185 views

Piecewise continuation of a discrete function on an area

I have a discrete function (finite set of values) defined on an area $\Omega$ in $R^2$. Each value of the function is defined on a subarea $\Omega_i$(triangle in my case). These triangles account for ...
2
votes
1answer
288 views

NDSolve cannot do a discontinuity replacement for event surfaces that depend only on time

I'm trying to solve a system of DAEs with discrete conditions: ...
1
vote
0answers
192 views

NDSolve unable to handle discontinuities

I'm trying to solve a set of ordinary non-linear differential equations but running into issues. Specifically, after supplying Mathematica the below definitions and evaluating the ...
1
vote
2answers
172 views

NFourierTransform gives wrong result

This is my code: ...
8
votes
1answer
348 views

Options of WhenEvent

I'm using NDSolve and WhenEvent to simulate building heating systems and their discontinuous operation. Here is a simplified example. The idea is quite simple. I have the following WhenEvents: <...
2
votes
1answer
373 views

Force derivative of piecewise function at boundary points to be one-sided derivative

I've defined a smooth step function given as f[x_] = Piecewise[{ {y0, x<x0-dx/2}, {y0+1/2(y1-y0)(1-Cos[Pi*x/dx]), x<x0+dx/2}, {y0, True} }]; ...
6
votes
2answers
623 views

Solving wave equation with singular initial conditions

I am trying to compute the solution to the wave equation using NDSolveValue and singular initial displacement (continuous, but not differentiable in a point). I ...
3
votes
0answers
118 views

NDSolve produces different solutions for the same set of equations [duplicate]

I've tried to simulate simple mechanical system - mass which is pulled on a spring. The code You can find below. Unfortunately, I can't get correct results. But, what has surprised me more, is that ...
4
votes
2answers
1k views

A discontinuity in a plot of a continuous function

I plot a continuous, though not a smooth function: Plot[If[a >= 0.5, 0, Sqrt[0.5 - a]], {a, -1, 1}, PlotRange -> All] which returns the following One can ...