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
I am trying to plot a stress strain curve using a model but the strain values don't start from zero. wonder if anyone can look at the template attached.
Why do you think the plot should start at 0?
The vector epsilon.t start with value 6.137*10^-3 and so does the plot.
Thanks for the question. Looking at the equation for epsilon.t and sigma t, a value of zero sigma t should yield a value of zero epsilon.t. If I just define sigma t as zero, I am in fact getting epsilon.t as zero as it should be. However when I define a set of values for sigma t from zero, it doesn't give me epsilon.t values starting from zero.
Thanks again for looking into this.
@Werner_E wrote:
Why do you think the plot should start at 0?
The vector epsilon.t start with value 6.137*10^-3 and so does the plot.
@Werner_E wrote:
Why do you think the plot should start at 0?
The vector epsilon.t start with value 6.137*10^-3 and so does the plot.
Thanks for the question. Looking at the equation for epsilon.t and sigma t, a value of zero sigma t should yield a value of zero epsilon.t. If I just define sigma t as zero, I am in fact getting epsilon.t as zero as it should be. However when I define a set of values for sigma t from zero, it doesn't give me epsilon.t values starting from zero.
Thanks again for looking into this.
Thanks for the question. Looking at the equation for epsilon.t and sigma t, a value of zero sigma t should yield a value of zero epsilon.t. If I just define sigma t as zero, I am in fact getting epsilon.t as zero as it should be. However when I define a set of values for sigma t from zero, it doesn't give me epsilon.t values starting from zero.
Yes, I see.
The problem is the calculation of gamma1 and gamma2. epsilon_/2 is a vector and (1-tanh(H)) is a vector, too. So the multiplication of the two is interpreted as the scalar product of these vectors and is not done elementwise.
You have to use vectorization to get the result you intended:
BTW, its a good idea to apply vectorization ALWAYS when doing calculations with a vector of input values (unless of course you want real vector operations to be done of course).
An even better approach is to set up the sheet so the calculations are done with single scalar input values only, turn them into functions of the input values and only after that you may use those functions vectorized with vectors as input values.
EDIT: See the next post of mine for an example.
Just as an afterthought - It may be a better idea to turn your calculations into functions dependent on sigma.t. That way you can avoid the vectorization necessary for plotting, get a smoother curve and have more flexibility for subsequent calculations.
See attached sheet.
Hi
You do not need the vectorization of the stress interpolation.
Cheers
Terry
@terryhendicott wrote:
Hi
You do not need the vectorization of the stress interpolation.
Cheers
Terry
Thats correct. I haven't even looked at the calculations after the wrong plot but now I have seen that global assignments (which i don't like and would not recommend) are used.
Fortunately "linterp" seems to ignore the vectorization operator as otherwise it should throw an error if used with vectorization.