Skip to content

Commit f3b45fe

Browse files
committed
adding function to estimate fold hinge location
finds the roots of the function for a given range and step size. Start looking at range[0] + step find root, then look at range[0]+step, to range[0]+2*step while <range[1] note the step should be smaller than the wavelength
1 parent 64f6f1c commit f3b45fe

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

LoopStructural/modelling/fold/fold_rotation_angle.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,18 @@ def set_function(self, function):
130130
-------
131131
132132
"""
133-
self. fold_rotation_function = function
133+
self. fold_rotation_function = function
134+
135+
def find_hinges(self,range,step):
136+
137+
import scipy.optimize as optimize
138+
def fra(x):
139+
x = np.array([x])
140+
return self.__call__(x)
141+
roots = []
142+
x = range[0]
143+
while x < range[1]:
144+
result = optimize.root_scalar(fra,bracket=[x,x+step])
145+
roots.append(result.root)
146+
x+=step
147+
return roots

0 commit comments

Comments
 (0)