cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Translate the entire conversation x

How do I connect a discontinuous piecewise function with vertical lines?

SJ_13091708
2-Explorer

How do I connect a discontinuous piecewise function with vertical lines?

I'm trying to plot a couple shear-moment diagrams, and have reactions in the middle of the beam causing the shear diagram below to jump discontinuously. How do I represent those jumps with vertical lines connecting them?

SJ_13091708_1-1742593689165.png

 

 

9 REPLIES 9
LucMeekes
23-Emerald IV
(To:SJ_13091708)

You mean, instead of this:

LucMeekes_5-1742596043850.png

You want this:

LucMeekes_6-1742596088136.png?

Attach your Prime worksheet (.mcdx) file and state which version of Prime you are using.

That will allow helping you in the best possible way.

 

Success!
Luc

Use the "stack" function to get one line

Hello @SJ_13091708

 

It looks like you have some responses from our community champions. If any of these replies helped you solve your question, please mark the appropriate reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.

Werner_E
25-Diamond I
(To:SJ_13091708)

How to achieve what you want to see depends on how you defined your function(s) - that's the reason we would have to see your sheet to be able to help.

 

Its just a guess but I can image that you defined your function using some kind of if...else if ... els if ... else cascade.

In this case you should not use Primes Quickplot feature (= not defining the variable (x) on the abscissa and letting Prime choose appropriate spacing) but rather define a range variable x to be used in the plot.

Here you see the difference:

Werner_E_0-1742613140133.png

 

BTW, from a mathematical point of view the first plot without the vertical line segments is the correct one!

 

LucMeekes
23-Emerald IV
(To:Werner_E)

Defining the abcisa range variable is usually necessary, but not enough, to get the vertical lines to display. The two plots I presented in my first response both have the abcisa range variable defined. The first with a step of 0.001, the second with a step of 0.05.

 

Luc

Werner_E
25-Diamond I
(To:LucMeekes)


@LucMeekes wrote:

Defining the abcisa range variable is usually necessary, but not enough, to get the vertical lines to display. The two plots I presented in my first response both have the abcisa range variable defined. The first with a step of 0.001, the second with a step of 0.05.

 

Luc


Using a step of 0.001 in a range from 0 to 180 exceeds a silly limit in Prime plots and Prime would only draw thin lines and will not allow to change line width, line style, etc.

 

But I agree that experimenting with the step width might be necessary.

 

One limit in Prime's plots is about 5000 points. If this limit is exceeded, Prime will not allow to change the line style and will only allow the dot as symbol.

Another limit is ca. 50000. If its exceeded Prime it will also refuse to change the line width.

These limits apply to the individual traces, not the sum of all points to be plotted.

Werner_E_1-1742738544919.png

The picture also shows that it may also happen that some vertical lines are drawn. other not.

Its most often but not always the larger step which does the job. In the example above a strep of 0.006 will just draw one of the vertical lines in the green plot, 0.005 will draw all of them.

LucMeekes
23-Emerald IV
(To:Werner_E)

I think it depends upon whether Prime 'senses' a peak in the derivative of the function or not:

With step 0.006:

LucMeekes_0-1742744252177.pngLucMeekes_1-1742744267372.png

with 0.005:

LucMeekes_2-1742744300486.pngLucMeekes_3-1742744318595.png

 

Luc

Werner_E
25-Diamond I
(To:LucMeekes)


@LucMeekes wrote:

I think it depends upon whether Prime 'senses' a peak in the derivative of the function or not:

 

That may be the case - we don't know how exactly plotting is implemented by PTC.

 

Not sure if hat theory fully explains these effects:

Werner_E_0-1742753922971.png

 

 

Use vector x and plot line or points which you want to plot.

image.pngimage.pngimage.pngimage.png

Announcements

Top Tags