For Loops With Matrices

1 Ansicht (letzte 30 Tage)
Kelly McGuire
Kelly McGuire am 11 Apr. 2017
Kommentiert: Star Strider am 11 Apr. 2017
So, I am trying to perform a global fit on 15 data traces obtained from electrophysiology. The first three traces had a concentration of 10 micromolar, the second three traces had a concentration of 100 micromolar, the third three traces had 500 micromolar, the fourth had 1 millimolar, and the fifth had 10 millimolar. The traces are nanoamps vs milliseconds. Ok, so I want to globally fit these 15 traces using a nonlinear custom nonlinear function with lsqcurvefit. Fitting the first three traces was simple since they all had the same concentration. How would I fit all of these traces using my nonlinear function and lsqcurvefit in a loop where the concentration changes? I thought maybe putting all of the xdata (milliseconds) in one matrix, and the ydata (nanoamps) in another matrix and using those as the xdata and ydata that are called into lsqcurvefit, and that worked if the concentration is a fixed number. Now, how would I do this if my matrix was 15 dimensions, and every three columns I needed the nonlinear function to start using a different concentration? I hope this was mostly clear.

Akzeptierte Antwort

Star Strider
Star Strider am 11 Apr. 2017
Mostly, but not entirely.
The lsqcurvefit function is the correct choice.
It would be necessary to know the equations you want to fit, and if the concentration of the unknown substance could be parameterised within them.
How are the data related to the concentrations?
  4 Kommentare
Kelly McGuire
Kelly McGuire am 11 Apr. 2017
Bearbeitet: Kelly McGuire am 11 Apr. 2017

See attachment. I am measuring the current passing through the ion channel before and after drug is added to the bath. Before the red arrow (i.e. -180 nA), the ion channel has been activated by acidifying the bath. At the red arrow, drug is added to the bath and begins to block the current (i.e. blocking the ion channel). Notice though how it is an exponential block. k1 is the on rate constant of the drug and k-2 is the off rate constant of the drug. The ratio of these numbers tells us the EC50 (effective concentration that blocks 50% of the current). k1 and k-2 wouldn't change, they would be fixed numbers depending on the drug, we just don't know what those numbers are beforehand. Where the trace levels off is the equilibrium of the drug in the channel vs out of the channel, and that depends on k1 and k-2. In the equation I showed you, the drug concentration does show up in those sums as Co. The on rate, k1, is dependent on drug concentration, so everywhere there is a k1 in my equation, there is also a time-dependent drug concentration. The reason for time dependence in the drug concentration is because of diffusion up to the channel when the drug is added is time dependent (i.e. the concentration in the bath doesn't jump to, for example, 100 micromolar, it takes time for the unstirred layer around the channel to reach the maximum concentration).

Star Strider
Star Strider am 11 Apr. 2017
I assume the varying concentration of ‘Co’ are accounted for by ‘k1’.
I would define the start time as the time the drug is added to the bath.
It seems that if you have all the other constants (such as ‘Co’, whenever in your experiment you measure it), this is a relatively straightforward two-parameter estimation problem. If so, design your objective function to accept ‘Co’ as an input argument. You may need to use a loop in your objective function to provide the appropriate values of ‘Co’ to fit each column (or row) in your objective function matrix. This is going to be slow, but should be successful. Turn off the sleep option for your computer while you run this.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Nonlinear Least Squares (Curve Fitting) finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by