lambda^2 t^2 < alpha - (c ( Abs[t] - r)^2)/2
What I thought would be obvious,
Solve[lambda^2 t^2 < alpha - (c ( Abs[t] - r)^2)/2, t]
doesn't work. Nor does Eliminate seem suitable. So what should one do?
Sorry to ask what is probably an ignorant question.
--
Mike Hucka hu...@umich.edu http://www.eecs.umich.edu/~hucka
University
PhD to be, computational models of human visual processing (AI Lab)
of
UNIX systems administrator & programmer/analyst (EECS DCO)
Michigan
Michael:
1) For your example
In[180]:=
$Line=0;
In[1]:=
ineq = (lambda^2 t^2 < alpha - (c ( Abs[t] - r)^2)/2);
In[2]:=
sub = Expand[Subtract @@ ineq]
Out[2]=
2 2
c r 2 2 c Abs[t] -alpha + ---- +
lambda t - c r Abs[t] + ---------
2 2
In[3]:=
lft = Select[sub, !FreeQ[#1, t]& ]
Out[3]=
2
2 2 c Abs[t]
lambda t - c r Abs[t] + ---------
2
In[4]:=
rt = Select[-sub, FreeQ[#1,t]&]
Out[4]=
2
c r
alpha - ----
2
In[5]:=
lft<rt
Out[5]=
2 2
2 2 c Abs[t] c r lambda t - c r
Abs[t] + --------- < alpha - ----
2 2
2) Make a function to the job:
allow for arbitrary binary relations ( ==,<. >,<=.>= ...); allow for
sub not being a sum (not having head Plus).
In[6]:=
ToLeft[reln_, t_] :=
Module[{x,y,sub,rt,lft},
sub = Expand[Subtract@@ineq];
lft = Select[x+y+sub,!FreeQ[#1,t]& ];
rt = Select[x[t]+y[t]-sub,FreeQ[#1,t]&];
Head[reln][lft,rt]
]
Check:
In[7]:=
ToLeft[ineq, t]
Out[7]=
2 2
2 2 c Abs[t] c r lambda t - c r
Abs[t] + --------- < alpha - ----
2 2 --
Allan Hayes
Leicester, UK
h...@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 4198
1) use cases t>=0, t<0
2) make make it a problem in Abs[t]
In[1]:=
lambda^2 t^2 < alpha - (c ( Abs[t] - r)^2)/2;
In[2]:=
%/.t^2->Abs[t]^2
Out[2]=
lambda^2*Abs[t]^2 < alpha - (c*(-r + Abs[t])^2)/2
This problem in Abs[t] is solvable.
Allan Hayes
Michael Hucka wrote:
>
> I'd like to be able to rearrange some formulas involving inequalities,
> to get the inequality in terms of a certain variable. How can this be
> done in Mathematica 3.0? For example, I'd like to get 't' in the
> equation below on the left side by itself:
>
> lambda^2 t^2 < alpha - (c ( Abs[t] - r)^2)/2
>
> What I thought would be obvious,
>
> Solve[lambda^2 t^2 < alpha - (c ( Abs[t] - r)^2)/2, t]
>
> doesn't work. Nor does Eliminate seem suitable. So what should one do?
>
> Sorry to ask what is probably an ignorant question.
>
> --
> Mike Hucka hu...@umich.edu http://www.eecs.umich.edu/~hucka
> University
> PhD to be, computational models of human visual processing (AI Lab)
> of
> UNIX systems administrator & programmer/analyst (EECS DCO)
> Michigan
--
Allan Hayes
Mathematica Training and Consulting
ToLeft[reln_, t_] :=
Module[{x,y,sub,rt,lft},
sub = Expand[Subtract@@ineq];
lft = Select[x+y+sub,!FreeQ[#1,t]& ];
rt = Select[x[t]+y[t]-sub,FreeQ[#1,t]&];
Head[reln][lft,rt]
]
should be
ToLeft[reln_, t_] :=
Module[{x,y,sub,rt,lft},
sub = Expand[Subtract@@reln]; (****)
lft = Select[x+y+sub,!FreeQ[#1,t]& ];
rt = Select[x[t]+y[t]-sub,FreeQ[#1,t]&];
Head[reln][lft,rt]
]
Thanks to Seth Chandler for pointing this out.
Allan Hayes
******************
Allan Hayes wrote:
>
> Michael Hucka wrote:
> >
> > I'd like to be able to rearrange some formulas involving inequalities,
> > to get the inequality in terms of a certain variable. How can this be
> > done in Mathematica 3.0? For example, I'd like to get 't' in the
> > equation below on the left side by itself:
> >
> > lambda^2 t^2 < alpha - (c ( Abs[t] - r)^2)/2
> >
>