Jump to content
florian_lw

trim curve

Recommended Posts

Hi,

 

im looking for a function to trim a curve. The goal is to create a new curve in a different plot, that represents only a portion of the original curve vectors. Further goal is to keep the right hand trimming point variable, meaning that i want to trim the curve on the right hand side not at a fixed x-value, but by meeting the criterion: "trim at location where the y-value becomes zero" (occurs only once in every curve). This should also account for the case i reload the session containing the trim operation, but with varying curve values. Left hand trimming point may be a fixed x-value.

I already tried:

    1) the trim function: problem is, that right hand trimming point is not variable -> not workable

    2) macro Cut below limit: problem is, that after the limit, the newly created curve is extended by a horizontal line -> not workable  

 

Is there a function like this?

 

Curve_Screenshot.jpg.a0703b4a76719ad5f3914ef1e93431d7.jpg

 

Florian

 

Share this post


Link to post
Share on other sites
Guest

Hi Florian,

Can you try with the modify curve option, where user can trim the data outside of the selected range.

A tutorial, HG-1020: Modifying Plots, is also available in the Help Menu which shows about the various options available for editing curves. 

1Capture.PNG

Share this post


Link to post
Share on other sites

Hi George,

 

as i wrote, that option (it's what i meant by "trim function" ) doesn't work for me because the right hand trimming point is not variable, but is fixed to a certain x-value. I want the x-value to vary, accordingly to the value y = 0

Share this post


Link to post
Share on other sites
Guest

Hi Florian

As a workaround, using coordinate info option you can find the x-coordinate value  where the y coordinate value becomes zero. And you can provide these values (0 to _) in the 'From' 'To' options in the range thereby you can trim the curve within the range. Both the trimmings points are variable, please see the image attached.

 

 

Capture2.PNG

Share this post


Link to post
Share on other sites

Hi,

 

problem is, i want to automate the process.

Meaning that i want to save the trimming operation of the curve in a session. By relaoding this session, the trimming should automatically happen for a new curve (which i read in with the same session), where the y=0-point of this new curve can slightly differ from the previous curve.

 

So, if one used the suggestion in your last post:

When reloading the session with a new curve, the trimming operation would not hit the right x-value because the y=0 abscissa value has changed. But the x-value of the trimming should change according to the new curve.

 

Could you provide another solution? 

Share this post


Link to post
Share on other sites
Guest

Hi Florian,

It is possible to automate this process. As per the user requirements customization is possible using Tcl/Tk scripting.

Please refer Reference Guide which describes about Tcl/Tk scripting commands.

 

Or,

You can consult your local Altair team.

Share this post


Link to post
Share on other sites

Hi Florian,

 

One of my colleague suggested to try Hypermath by creating own function.

I have an example from HyperMath that takes the data only after a certain threshold is reached (for example, I want the force history after the displacement goes over 5).

 

function trimXbasedOnY(x,y,value)

                n,index = ZeroCrossings(y-value)

                if (n == 0 ) then

                                x_cut = []

                else       

                                x_cut = x[[index[1]+1:Length(x)]]

                end

                return x_cut

end

You could create something similar.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...