Solve App and Piecewise function
10-20-2015, 12:43 PM
Post: #1
 cclinus Junior Member Posts: 40 Joined: Oct 2015
Solve App and Piecewise function
Hello,

I try to solve two equations in Solve App.
E1: E=C MOD 5
E2: F=PIECEWISE(E not equal 0,E,E==0,5)

Then in Num view, uncheck C and enter C=5 and press Solve.
The answer of E is 0, OK
But, the answer of F is also 0, Wrong.
F is supposed to be 5.

Did I do anything wrong?
10-21-2015, 07:15 AM
Post: #2
 parisse Senior Member Posts: 1,309 Joined: Dec 2013
RE: Solve App and Piecewise function
You can not expect to solve these kind of systems/equations with a numeric solver (and it is not supported by the exact solver and won't be).
10-21-2015, 09:19 AM
Post: #3
 cclinus Junior Member Posts: 40 Joined: Oct 2015
RE: Solve App and Piecewise function
Hi ,

If the Solve App allow user to solve multi equations, I will expect it can solve these equations.

See another example. If I modify the equations to as follows, the Solver work perfectly.

Sorry for my poor English.
10-22-2015, 08:08 AM
Post: #4
 parisse Senior Member Posts: 1,309 Joined: Dec 2013
RE: Solve App and Piecewise function
You are wrong:-)
I can not add safeguards everywhere because that would disable using the calc for legitimate systems. If for example I returned an error as soon as the user enters a discontinuous fonction, then you would not be able to solve a system at a continuous solution with a function having discontinuities.
The user is assumed to be the brain and the calc is assumed to compute.
10-22-2015, 01:46 PM (This post was last modified: 10-22-2015 03:43 PM by cclinus.)
Post: #5
 cclinus Junior Member Posts: 40 Joined: Oct 2015
RE: Solve App and Piecewise function
Ok, but, why the second example work well?

Do you mean you make the Solve app? Or I misunderstand your meaning?

By the way, did you read my another post about solver , ABS() and IP().
I more concern that problem, because solver give wrong answer under some condition.

thanks!
10-22-2015, 04:08 PM (This post was last modified: 10-22-2015 04:10 PM by Han.)
Post: #6
 Han Senior Member Posts: 1,882 Joined: Dec 2013
RE: Solve App and Piecewise function
(10-22-2015 01:46 PM)cclinus Wrote:  Ok, but, why the second example work well?

In the second example, your piecewise function consists of two functions that are each continuous on either half-open or half-closed intervals. In the first example, your piecewise function has a piece that is nowhere continuous.

A lot of numerical solving algorithms tend to use some sort of Newton process, which requires that the auxiliary function for the system to be continuous over some interval. As an example,

2x+3y = 5
5x-4y = 1

This system is equivalent to solving $$\vec{F}(x,y) = 0$$ where
$\vec{F}(x,y) = \begin{bmatrix} 2x+3y-5 \\ 5x-4y-1 \end{bmatrix}$

Generally speaking, the zeroes of $$\vec{F}(x,y)$$ can be estimated by Newton's method; however $$\vec{F}$$ must be differentiable (and hence continuous) near the zero. This is why systems with piecewise functions where the solution itself occurs at a point of discontinuity will likely never be found by numerical methods (that use Newton-like processes).

Graph 3D | QPI | SolveSys
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)