You will find the critical micelle concentration of a surfactant from conductivity readings, without numpy.
The idea. Below the CMC the readings lie on one straight line, and above it on another, less steep one. The CMC is where the two lines cross. The function line returns the slope and intercept of a least squares line.
Your tasks.
split(conc, kappa, n). It returns two lists of points: the first n points and the rest, each as a pair of lists.crossing(s1, c1, s2, c2). It returns the concentration where the lines and meet.cmc(conc, kappa, n). It fits both lines and returns the crossing point.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…