| |
comp.soft-sys.math.mathematica |
On 3 , 13:48, "misno...@gmail.com" <misno...@gmail.com> wrote: > temp = Piecewise[{ > }] > I want to either solve this via > N -> Piecewise[{ > }] > or just get mathematica to realise that there is a common term - N, > from where solve can handle it perfectly well. > Is this type of operation possible, or am I stuck editing them by hand? In[55]:= N /: Default[N, 2] := {MachinePrecision, Infinity} So, how about In[57]:= Out[57]= In[59]:= Out[59]= Cheers
> requires solving of a piecewise function, which I cannot work out how
> to do. Say I have a piecewise function of the form
> { 2*N*x, x < 0},
> { N*x, x >= 0}
> Solve[1==temp, N]
> and either get, with the inequalities,
> {1/(2*x), x < 0},
> {1/x, x >= 0}
> and factor it out to, say,
> N * Piecewise[{
> {2*x, x < 0},
> {x, x >= 0}}]
Information[N]
give a result with n-digit precision."
temp = Piecewise[{{2*n*x, x < 0}, {n*x, x >= 0}}]
Piecewise[{{2*n*x, x < 0}, {n*x, x >= 0}}]
Reduce[temp == 1, n]
(x > 0 && n == 1/x) || (x < 0 && n == 1/(2*x))
Dimitris