Re-arranging an exponential function of 2 parts

조회 수: 3 (최근 30일)
Simon
Simon 2011년 11월 9일
A curve fitting exercise on my data has shown that the best fit is achieved with a 2 part exponential method of form:
y = a*exp(b*x) + c*exp(d*x)
Whilst 'y' is the dependent variable (soil water content) and 'x' the independent variable (soil water potential), it would be useful if I could also rearrange the equation to calculate 'x' from known values of 'y'. This will help me to identify causes of this change.
I'm pretty new to logs and differentiation etc. Does anybody know a way to do this?
Cheers
Simon

답변 (1개)

Jonathan
Jonathan 2011년 11월 9일
Simon,
There is no logarithm rule that allows you to solve for x explicitly. However, from differentiating we can see that if a*b and c*d are either both positive or both negative, then y(x) is monotone. This means that y(x) is a one-to-one function and has a well defined inverse. In this case, the function fzero can be used to determine the an x value from a y value. Here's how.
% Determine constants from a fitting routine. Dummy data here.
a = 1;
b = 2;
c = 3;
d = 4;
% Create an anonymous function for representing the fit.
f = @(x) a*exp(b*x) + c*exp(d*x);
% For a y value of interest, find x.
y_given = f(1); % This example y value corresponds to x = 1.
x_calculated = fzero(@(x) f(x) - y_given, 0);
Enjoy,
Jonathan

카테고리

Help CenterFile Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by