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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to scoot over same function a few units to the right?

jrodriguez-9
5-Regular Member

How to scoot over same function a few units to the right?


Hi all I want to scoot over same function a few units to the right. I am trying this but at the end is not moving to the right the 8 ft axtra that started. also graph 2 does not seem right. please advise.

5 REPLIES 5
jrodriguez-9
5-Regular Member
(To:jrodriguez-9)

Untitled.pngUntitled2.pngUntitled3.png

The simplest definition of DeltaGirder2 would be:

DeltaGirder2(x):DeltaGirder1(x-8ft)

You would then need to redefine DeltaGirder1(x) to be zero if x<0.


The more difficult way to define DeltaGirder2 is to replace all instances of x2 with (x2-8ft).

Also, I agree with Werner's comments regarding your range variable.

MJG
18-Opal
18-Opal
(To:MJG)

Here's an example with completely different functions:

Here I used "NaN" to make the f1 undefined outside of 0<x<8, but you could change that to 0 if you prefer.

(edited to add f3 to show the "hard way").

More simple with the return operator

Return.png

I am not sure if I understand your question, what you mean by "scoot over same function a few units to the right" or by "at the end is not moving to the right the 8 ft axtra that started" and what you think is not OK with your graph (you get what you demanded).

Maybe it helps to say that the range variables you define are only necessary for plotting and I don't understand, why you use two different ranges (x1 and x2).

Try to define just one range x:=0 ft, 1ft .. 300 ft and plot the two functions with Delta_girder1_SDL(x) and Delta_girder2_SDL(x).

You don't have to change anything in your function definitions as the name of the formal arguments used there does not matter at all. If all is working OK you may consider changing x1 and x2 to x there later.

OR

If the goal was only to shift a function to the right by 8 feet, you should do it that way.

Define your first function the normal way Delta_girder1_SDL(x) := ..... and then you simply would define Delta_girder2_SDL(x) := Delta_girder1_SDL(x-8 ft). Thats all.

BTW, you should always include a normal else statement at the end to copy for values out of range. In your definition the function will fail for arguments greater that 300 feet.

P.S.: Looks like messages come in here with some delay. Haven't seen Marks answers when I started to post and edit my answer. After posting I see we have about the same answer. Is there any moderating delay going on here?

Top Tags