Hi,
I am writing a code to define a spring. And I need to use strain(n-1) to calculate strain(n).
However, I dont know how to do it.
I used commitStrain but it did not worked.
Can you help me??
for exdample;
"
double dStrain = fabs(strain) - fabs(commitStrain);
if (dStrain < 0.0) {
unloading ();
} else {
loading ();
}
"
for this code it always goes to loading, I dont understand why?
Thank you
Strain (n-1)
Moderators: silvia, selimgunay, Moderators
Re: Strain (n-1)
fabs() retruns the absolute value of x, i.e. |x|
Re: Strain (n-1)
fmk,
Thank you for your help.
But I know what fabs() means.
I tried to find the difference between absolute value of current (time n) strain and absolute value of previous (time n-1) strain.
Thus, I used "commitStrain" as previous (time n-1) strain. Is it true?
Thank you for your help.
But I know what fabs() means.
I tried to find the difference between absolute value of current (time n) strain and absolute value of previous (time n-1) strain.
Thus, I used "commitStrain" as previous (time n-1) strain. Is it true?
Re: Strain (n-1)
did you spit out the two values to see what the values are,
i.e.
opserr << fabs(strain) << " " << fabs(commitStrain) << endln;
i.e.
opserr << fabs(strain) << " " << fabs(commitStrain) << endln;
Re: Strain (n-1)
I have checked commitStrain. It alwasys equals to zero.
I dont understand why?
strain is ok.
I dont understand why?
strain is ok.