Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Inequality question

Subject: Inequality question

From: Sprinceana

Date: 17 Apr, 2009 12:15:05

Message: 1 of 11

I have the following inequality:

-2<=648424649/617174649-154164883/3085873245*y+46354883/3085873245*x-74824961/15429366225*y*x-100/74529*x^2-100/74529*y^2<=2

Which is the best method to trace y=f(x) if we had an equation by type y-x=2

Is this possible to write y=x+2

Thanks in advance!

Subject: Inequality question

From: John D'Errico

Date: 17 Apr, 2009 13:09:01

Message: 2 of 11

"Sprinceana " <mihaispr@yahoo.com> wrote in message <gs9rs9$62a$1@fred.mathworks.com>...
> I have the following inequality:
>
> -2<=648424649/617174649-154164883/3085873245*y+46354883/3085873245*x-74824961/15429366225*y*x-100/74529*x^2-100/74529*y^2<=2
>

No. You have a pair of inequalities, not a
single inequality relationship.


> Which is the best method to trace y=f(x) if we had an equation by type y-x=2

Define "trace" here. Do you wish to plot this
relationship? Why not use plot?

help plot
lookfor plot

The general scheme would seem trivial.

1. Generate a list of points x.
2. Compute y = f(x).
3. Delete those (x,y) pairs which fail to satisfy
the pair of inequality relationships given above.
4. Use plot(x,y,'-') on those remaining points.


> Is this possible to write y=x+2

You just wrote it. What is the problem?

John

Subject: Inequality question

From: someone

Date: 17 Apr, 2009 17:57:01

Message: 3 of 11

"John D'Errico" <woodchips@rochester.rr.com> wrote in message

... snip ...
>
>
> > Is this possible to write y=x+2
>
> You just wrote it. What is the problem?
>
> John

Thats a classic.

Your answers always manage to educate and/or amuse me.

Keep it up!

Subject: Inequality question

From: Sprinceana

Date: 17 Apr, 2009 18:27:01

Message: 4 of 11

"someone" <someone@somewhere.net> wrote in message <gsaftd$70n$1@fred.mathworks.com>...
> "John D'Errico" <woodchips@rochester.rr.com> wrote in message
>
> ... snip ...
> >
> >
> > > Is this possible to write y=x+2
> >
> > You just wrote it. What is the problem?
> >
> > John
>
> Thats a classic.
>
> Your answers always manage to educate and/or amuse me.
>
> Keep it up!

Can you help me please?

Subject: Inequality question

From: ImageAnalyst

Date: 17 Apr, 2009 18:56:53

Message: 5 of 11

On Apr 17, 2:27=A0pm, "Sprinceana " <mihai...@yahoo.com> wrote:
> > ... snip ...
>
> Can you help me please?-

---------------------------------------------------------------------------=
-
Sprinceana :
I doubt it (John already did anyway). What are you looking for? Like
John, I'm not sure. What does your second statement/equation have to
do with your first one? I haven't plotted it but, just taking a
guess, is it (the first equation) a pair of hyperbolas and the
inequality specifies the region between them? Do you want to plot
lines at the boundaries and have the area/region between the
hyperbolas shaded a different color than the two regions "contained"
by the hyperbolas? That's my best guess so if that's correct, say
so. If it's not correct, say so. But I think John's numerical
solution might be the first route you should try - it seems pretty
easy and straightforward. Did you try that before you asked for
additional help??? If not, why not? If so, where is your code?
Regards,
ImageAnalyst

Subject: Inequality question

From: someone

Date: 17 Apr, 2009 19:02:01

Message: 6 of 11

"Sprinceana " <mihaispr@yahoo.com> wrote in message <gsahll$72l$1@fred.mathworks.com>...

> > ... snip ...
> > >
>
> Can you help me please?

John outlined the solution for you in his original reply:

Sprinceana " <mihaispr@yahoo.com> wrote in message <gs9rs9$62a$1@fred.mathworks.com>...
> I have the following inequality:
>
> -2<=648424649/617174649-154164883/3085873245*y+46354883/3085873245*x-74824961/15429366225*y*x-100/74529*x^2-100/74529*y^2<=2
>

No. You have a pair of inequalities, not a
single inequality relationship.


> Which is the best method to trace y=f(x) if we had an equation by type y-x=2

Define "trace" here. Do you wish to plot this
relationship? Why not use plot?

help plot
lookfor plot

The general scheme would seem trivial.

1. Generate a list of points x.
2. Compute y = f(x).
3. Delete those (x,y) pairs which fail to satisfy
the pair of inequality relationships given above.
4. Use plot(x,y,'-') on those remaining points.

... snip ...

John

All you need to do is write the "trivial" MATLAB code.
Whats the problem?
What have you tried?
Where are you stuck?
What error messages do you get?

Subject: Inequality question

From: John D'Errico

Date: 17 Apr, 2009 19:24:01

Message: 7 of 11

"Sprinceana " <mihaispr@yahoo.com> wrote in message <gsahll$72l$1@fred.mathworks.com>...
> "someone" <someone@somewhere.net> wrote in message <gsaftd$70n$1@fred.mathworks.com>...
> > "John D'Errico" <woodchips@rochester.rr.com> wrote in message
> >
> > ... snip ...
> > >
> > >
> > > > Is this possible to write y=x+2
> > >
> > > You just wrote it. What is the problem?
> > >
> > > John
> >
> > Thats a classic.
> >
> > Your answers always manage to educate and/or amuse me.
> >
> > Keep it up!
>
> Can you help me please?

What is your problem? Elaborate. How can we
know what you are stuck on? I already suggested
a simple solution to what I guessed is your question.
It was a wild guess though, so I certainly won't be
willing to invest any significant amount of time to
solve the wrong problem.

Do you just not want to write any code yourself?
Nobody will be jumping up to help you if that is
your plan. Otherwise you will just learn to plead
for help every time you can't be bothered to write
code.

john

Subject: Inequality question

From: Roger Stafford

Date: 18 Apr, 2009 04:18:01

Message: 8 of 11

"Sprinceana " <mihaispr@yahoo.com> wrote in message <gs9rs9$62a$1@fred.mathworks.com>...
> I have the following inequality:
>
> -2<=648424649/617174649-154164883/3085873245*y+46354883/3085873245*x-74824961/15429366225*y*x-100/74529*x^2-100/74529*y^2<=2
>
> Which is the best method to trace y=f(x) if we had an equation by type y-x=2
> Is this possible to write y=x+2

  As others have indicated, your question is worded in a very obscure fashion. We're not sure what you mean by "trace f(x)", and you haven't defined what you mean by f(x) as far as I can see, nor the relevance of the equation y-x = 2.

  Just possibly you are asking, as John has guessed, how to solve for y in terms of x if each of your inequalities is converted to an equality:

 -2 = 648424649/617174649 - 154164883/3085873245*y + ...

and

  2 = 648424649/617174649 - 154164883/3085873245*y + ...

corresponding to the two boundaries of the region defined by the inequalities.

  If so, that is a very easy problem. Each of these is a quadratic equation in y with coefficients that involve x. Just use the standard solution for quadratic equations you learned in high school:

 a*y^2 + b*y + c = 0

gives the two solutions

 y = (-b+sqrt(b^2-4*a*c))/(2*a) and y = (-b-sqrt(b^2-4*a*c))/(2*a)

where in your case the a, b, and c are expressed in terms of x. For each of the original equations, you will have either two real solutions, one real, or none, depending on the value within the square root which in turn depends on the value of x. As 'ImageAnalyst' has stated, each of the original equations represents the two branches of a hyperbolic conic section, so you will have four distinct branches altogether. The two hyperbolas have the same pair of asymptote lines.

Roger Stafford

Subject: Inequality question

From: Sprinceana

Date: 18 Apr, 2009 10:43:01

Message: 9 of 11

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <gsal0h$n6o$1@fred.mathworks.com>...
> "Sprinceana " <mihaispr@yahoo.com> wrote in message <gsahll$72l$1@fred.mathworks.com>...
> > "someone" <someone@somewhere.net> wrote in message <gsaftd$70n$1@fred.mathworks.com>...
> > > "John D'Errico" <woodchips@rochester.rr.com> wrote in message
> > >
> > > ... snip ...
> > > >
> > > >
> > > > > Is this possible to write y=x+2
> > > >
> > > > You just wrote it. What is the problem?
> > > >
> > > > John
> > >
> > > Thats a classic.
> > >
> > > Your answers always manage to educate and/or amuse me.
> > >
> > > Keep it up!
> >
> > Can you help me please?
>
> What is your problem? Elaborate. How can we
> know what you are stuck on? I already suggested
> a simple solution to what I guessed is your question.
> It was a wild guess though, so I certainly won't be
> willing to invest any significant amount of time to
> solve the wrong problem.
>
> Do you just not want to write any code yourself?
> Nobody will be jumping up to help you if that is
> your plan. Otherwise you will just learn to plead
> for help every time you can't be bothered to write
> code.
>
> john

Truly is not my assignement this I want to help a friend that has something like that to solve:).

And I want to help him that's why I'm asking here:) john.

I don't have any ideas of what he needs to do but I simply want to help him.

Subject: Inequality question

From: Sprinceana

Date: 18 Apr, 2009 10:46:01

Message: 10 of 11

"Sprinceana " <mihaispr@yahoo.com> wrote in message <gs9rs9$62a$1@fred.mathworks.com>...
> I have the following inequality:
>
> -2<=648424649/617174649-154164883/3085873245*y+46354883/3085873245*x-74824961/15429366225*y*x-100/74529*x^2-100/74529*y^2<=2
>
> Which is the best method to trace y=f(x) if we had an equation by type y-x=2
>
> Is this possible to write y=x+2
>
> Thanks in advance!

I want to help him solve this thing I don't have any ideas about using inequalities in matlab but I simply want to learn myself about that helping him in the meantime.

I try to understand his problem that's why I posted here he needs to do that for a homework for next weeks so he is in a hurry.

If you don't want to help me I shall told him but I also want to understand how to use inequalities in matlab I didn't work with them.

Subject: Inequality question

From: John D'Errico

Date: 18 Apr, 2009 12:49:01

Message: 11 of 11

"Sprinceana " <mihaispr@yahoo.com> wrote in message <gscb19$7fi$1@fred.mathworks.com>...
> "Sprinceana " <mihaispr@yahoo.com> wrote in message <gs9rs9$62a$1@fred.mathworks.com>...
> > I have the following inequality:
> >
> > -2<=648424649/617174649-154164883/3085873245*y+46354883/3085873245*x-74824961/15429366225*y*x-100/74529*x^2-100/74529*y^2<=2
> >
> > Which is the best method to trace y=f(x) if we had an equation by type y-x=2
> >
> > Is this possible to write y=x+2
> >
> > Thanks in advance!
>
> I want to help him solve this thing I don't have any ideas about using inequalities in matlab but I simply want to learn myself about that helping him in the meantime.
>
> I try to understand his problem that's why I posted here he needs to do that for a homework for next weeks so he is in a hurry.
>
> If you don't want to help me I shall told him but I also want to understand how to use inequalities in matlab I didn't work with them.

Yes, but the issue is we don't know what you
are asking. How can we answer a question that
nobody understands? The problem is not a
difficult one, but your expression of it has made
no sense.

Are you asking how to convert y - x = 2 into the
the relationship y = x + 2? I'm sorry, but this is
a question in Algebra 1, not MATLAB. Do you
have/need the symbolic toolbox? Nobody knows
what you are asking.

Likewise, what does the inequality mean? Do you
wish to plot a line, subject to the inequality
constraints?

I explained what you must do fairly concisely, but
we don't do homework here, nor do we generally
care that your friend must finish their homework
assignment. Poor planning on your part does not
constitute an emergency for us.

John

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us