Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program to tick solution in graph

Status
Not open for further replies.

marrcin9g

Structural
Feb 28, 2013
5
Hi

I would like mark solution on graph for some function, for example I have 6 function and I want to hatch the common area:
f1(x)>=...
f2(x)>=...
f3(x)>=...
f4(x)>=...
f5(x)>=...
f6(x)<=...
Have you any idea how can I do that?
 
Replies continue below

Recommended for you

search the PTC Mathcad forum; there have postings about this. Also, look "Creating Amazing Images with Mathcad"

TTFN
faq731-376
7ofakss

Need help writing a question or understanding a reply? forum1529
 
Thank for reply, I found file "Creating Amazing Images with Mathcad" and I check whole file there is a lot of amazing function but unfortunately I didn't find solution my problem. Have somebody idea how to do it?

I'm sorry for my english, it isn't my first language
 
marrcing9 said:
I'm sorry for my english, it isn't my first language
Neither it_s mine ;-)
It would have been a good idea to state, which flavor of the program you use - that is either real Mathcad or just Prime.

The author of those outstanding "Amazing Images..", Prof. Byrge Birkeland, has also posted routines to hatch the area between to curves.
For MC15: [URL unfurl="true"]http://communities.ptc.com/docs/DOC-3380[/url]
For Prime:[URL unfurl="true"]http://communities.ptc.com/docs/DOC-3495[/url]

In the good old Mathsoft times there used to be a good repository of utility files but PTC has broken that as they did with so many other things. Sometimes we are lucky to find those old goodies using the wayback machine:
http://www.mathcad.com/support/item/examples/02oct/user.mcd][/url]

You may find other routines in the PTC forum as this subject comes up ever so often and was discussed a couple of times. But the best you could find are routines to hatch the area between just two curves. For your problem you will have to deal with the various points of intersection yourself and keep track between which two curves you have to hatch for which interval and also dealing with the case that there is no common area at all.
 
I use MC15. I know it could be case without common area but it isn't a problem I always could something write, for example: "No common Area, change variable A".
Finding common area between two curves is simpler because we know that one of them is at up and another is at down, with 6 functions is bigger problem.

I'm sorry for my english, it isn't my first language
 
The first thing you will have to do is to define exactly what you mean by "common" area! This isn't that trivial as it may look. It would utilize either vector definitions or boolean expressions.
Take a simple triangle ABC for instance. AB=c being horizontal, A to the left, C being above c. You may think its clear where the "inside" or common area is but you would have to define it. In our case you could create an oriented path ABC, counterclockwise and define the the "inner side" is the direction of the normal vector which we get when we turn the tangent vector counter clockwise, considering the oriented path ABC.
You may also define an "inside" orientation for each function: Inside is to the right (clockwise normal vector) of a and b (if we go from left to right) and to the left of c. But then, why the change in orientation of c? This will be different if the position of the triangle changes.
Another approach can be using boolean expressions which comes especially natural for a task like linear optimization.
Once you have defined what common area means it should not be that difficult to write a routine which determines and hatches it automatically, but I guess you will have to deal with a lot of special cases.
Anyway, concerning the hatching, the provided links should get you up an running.
Good luck and Merry Christmas!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor