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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Re: Help with Linterp plotting please

uclphd
1-Newbie

Re: Help with Linterp plotting please

Hi

Attached are two plots, A. which uses points that allow me to plot a triangular shaped curve using the linterp function and B. which uses points that won't let me plot as the error states vectors must be in assending order.

For B. how can I plot this rectangular shaped curve using Linterp function? Ultimately I wish to obtain a plot and a function (with respect to t as in plot A.) for the curve

Thanks

Omar

14 REPLIES 14
MikeArmstrong
5-Regular Member
(To:uclphd)

Firstly have a look at the attached sheet. A much cleaner way of setting up your worksheet, well in my opinion anyway.

In your evaluation of Pt2 you have tbd in there twice, Linterp calculates the slope and intercept of the line that passes through each pair of points. If the x-values of two points are the same then the slope is infinite.

Mike

If you slightly increase the second value of t.bd you get the following result.

Mike

Thanks for that.

Is there another function other than linterp that i can use to plot the same thing?

Omar

RichardJ
19-Tanzanite
(To:uclphd)

If all you want is a plot, just plot column 1 vs column 2.

It is not possible to turn your data into a function, because at the point tdb the function would be undefined. So if you want something other than just a plot, you will have to explain what you are trying to achieve.

I note you mention "time steps". If this is supposed to represent something real than you cannot have a perfect step function of time. Nothing happens instantly.

I'd like to use the function from the curve plot as part of a differential equation (equation of motion) that I will solve using runge kutta.The reason for turning the data into a function is to use this function as an input to a differential equation which i can then solve using the built in fourth order Runge Kutta function.

The plot is basically a force time history (acting on a structural member) and the differential equation is the equation of motion used to determine a deflection time history of the structural member.

So ideally obtaining a function would be usefull, any thoughts?

Omar

RichardJ
19-Tanzanite
(To:uclphd)

You could try just a simple piecewise function.

wayne
3-Visitor
(To:uclphd)

Attached is another method, using a simple program to define the force input, it takes a little more time, but doesn't suffer the vertical line problem.

I assume you want a numerical solution since you have a time step and both metods will work for that, But if you want symbolically, do in do in two steps, less than tbd and greater than tb.

uclphd
1-Newbie
(To:wayne)

Hi,

many thanks for that, seems to work.

Omar

MikeArmstrong
5-Regular Member
(To:wayne)

Nice Wayne,

Got to say though making everything a function of t is horrible. Creating a vector of values is a much neater way.

Mike

Got to say though making everything a function of t is horrible. Creating a vector of values is a much neater way.

I disagree. Once you have a function you can do anything, including create a vector of values. The reverse is not true.

Functions are very functional

MikeArmstrong
5-Regular Member
(To:RichardJ)

I disagree. Once you have a function you can do anything, including create a vector of values. The reverse is not true.

Yes that is true. It's when a lot of functions become dependant on a single variable I think it looks untidy.

Functions are very functional

That is terrible.

http://communities.ptc.com/servlet/JiveServlet/showImage/38-1286-6356/thwack.gif

Mike

MikeArmstrong
5-Regular Member
(To:wayne)

Just to be pedantic and optimize it a little further, we can get rid of the If statement.

Clipboard01.jpg

Mike

Yes I agree with Richard, functions are very functional, but, wait, functionals are functions of functions, which sounds like a closed loop which is not a function but an equation, so functions are very equational?

Any way, what he is really after is a function of time, not the graph.

I always forget about using the boolean function that way, thanks.

But I get confused quickly, so I generally don't use any way, at least not until everything is working.

MikeArmstrong
5-Regular Member
(To:wayne)

Yes I agree with Richard, functions are very functional, but, wait, functionals are functions of functions, which sounds like a closed loop which is not a function but an equation, so functions are very equational?

Confused......

http://communities.ptc.com/servlet/JiveServlet/showImage/38-1286-7413/confused.gif

I always forget about using the boolean function that way, thanks.

But I get confused quickly, so I generally don't use any way, at least not until everything is working.

I'm the same, and your example was working. Didn't want to be left out of producing something useful

Mike

Top Tags