equation with parametric integrand

조회 수: 12 (최근 30일)
domenico fabrizi
domenico fabrizi 2016년 11월 12일
댓글: Walter Roberson 2016년 11월 14일
I have a function f(x) depending on two parameters and a function z(x) not depending on any parameter a and b. I have to find the values of these two parameters. I have two equations in which f(x) is involved.
the first: integral between 0.5 and 1 of f(x) in dx is 0.62
the second: integral of f(x)*z(x) between 0 and 0.55 equal to 0.24.
I cannot implement a code able to compute the values of a and b.
How is it possible to find values of parameters of an integrand? are there any available code?
so far I tried a minimization approach but results are not satisfying.
thanks in advance
  댓글 수: 2
Walter Roberson
Walter Roberson 2016년 11월 12일
편집: Walter Roberson 2016년 11월 12일
Are f and z known functions? If they are not, then NO, there is no hope of finding the parameters. If they are known, we need to see them.
domenico fabrizi
domenico fabrizi 2016년 11월 12일
z is completeley known, whereas f depends on two parameters.

댓글을 달려면 로그인하십시오.

답변 (2개)

John D'Errico
John D'Errico 2016년 11월 12일
Hmm. I recall very recently seeing a question like this, with unknowns a and b in an integral. I think the functions were rather complicated.
In almost all cases though, you will NOT be able to gain an analytical solution. You have two nonlinear equations in two unknowns. In most cases for complicated equations, there will be no analytical solution.
So, why do I expect there will be no solution? You cannot even compute these integrals analytically. If you could do so, then you would have done it, and then you would be asking how to solve a system of two nonlinear equations in two unknowns.
So at best, this is a numerical problem. vpasolve can sometimes solve such problems, but not always. Or, you could carefully turn it into a pair of calls to integral, conditional on known values of a and b. Then you could in theory use fsolve. Not trivial, and then you need to deal with all sorts of issues like convergence, how to locate multiple solutions, starting values, etc.
  댓글 수: 1
domenico fabrizi
domenico fabrizi 2016년 11월 13일
in order to be more precised and more focused on my problem:f(x) is the normal probability density, depending on mean and variance. Whereas z(x) can be equal to x. Do you have any further advise? thanks

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2016년 11월 13일
This cannot be solved with the given information.
Consider
syms f(x) a b
f(x) = a * b * x;
z(x) = x * 108000/41261;
A = solve(int(f(x),x,sym(1)/2,sym(1))==sym(62)/100,a);
int( subs(f(x)*z(x), a, A), x, 0,sym(55)/100)==sym(24)/100
ans =
6/25 == 6/25
So the first integral works out because we ask it to find the a that makes it true. Then the second integral works out always. But what are a and b ? We know from A that a is 124/(75*b) but there is no a or b in the second equation, so we have nothing to go on.
A moment's reflection on the form of f(x) and z(x) will show you that nothing in them would have changed if a*b had been replaced by a single variable c . We can, in this situation, solve for the product a*b but not for the two values individually.
Therefore the general task is impossible. This is no possible solution for every possible form of f(x) and z(x) . There are solutions for some forms of f(x) and z(x).
  댓글 수: 2
domenico fabrizi
domenico fabrizi 2016년 11월 13일
in order to be more precised and more focused on my problem:f(x) is the normal probability density, depending on mean and variance. Whereas z(x) can be equal to x. Do you have any further advise? thanks
Walter Roberson
Walter Roberson 2016년 11월 14일
With that f(x) and that z(x), both f(x) and f(x)*z(x) have closed form integrals (with erf). But there is no pretty closed form solution to the simultaneous equations. I suggest using vpasolve()
syms mu sigma real
assume(sigma >= 0)
Pi = sym('pi');
eqn = [int(exp(-(x-mu)^2/(2*sigma^2))/sqrt(2*sigma^2*Pi), x, 1/2, 1) == 0.62, int(exp(-(x-mu)^2/(2*sigma^2))*x/sqrt(2*sigma^2*Pi), x, 0, 0.55) == 0.24]
sol = vpasolve(eqn)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by