Solving symbolic equations that contain numeric integration
이전 댓글 표시
I am trying to solve several equations simultaneously. These equations have multiple variables, complex sine/cosine and triple integration. I have problems in both integration and equation solving. Here are my questions.
1. About integration: after integration, I need to get a function that still has several unknown parameters. should I use symbolic integration "int()" or numeric integration "dblquad()" if the function expression is really complex?
2. about equation solving: which way is faster, symbolic "solve()" or numeric like "fmincon()"? Here is my code for using "fmincon()". Is the logic right?
%%f1,f2,f3,f4 are four functions with four unknown variables x phi lamda4 lamda
out=(f1-1)^2+(f2-2)^2+(f3-3)^2+(f4-f4)^2;
syms x1
subs(out,x,x1(1));
subs(out,phi,x1(2));
subs(out,lamda2,x1(3));
subs(out,lamda4,x1(4));
x0=[pi/6 pi/6 -1 -2];
lb=[0 0 -20 -20];
ub=[2*pi 2*pi 0 0];
syms x1 clear;
[x1,fval,exitflag,output]=fmincon(out,x0,[],[],[],[],lb,ub);
채택된 답변
추가 답변 (1개)
Christopher Creutzig
2011년 1월 21일
1. About integration: after integration, I need to get a function that still has several unknown parameters. should I use symbolic integration "int()" or numeric integration "dblquad()" if the function expression is really complex?
If the result of integration contains free parameters, you cannot use numeric integration. Quadrature (i.e., numeric integration) can only return a number, and you may be able, depending on your problem, to get an approximation to the formula you are looking for by interpolating from numerical answers to parameter values, but numerical quadrature by itself will not be able to tell you that the result is something like 0.1234*sin(a)+5.6. Also note that quadrature is, necessarily, limited to definite integration.
What Walter said, is correct, though: The number of complicated formulas for which a symbolic integral exists (let alone having an algorithm/a computer program that can find them) is not all that big really.
댓글 수: 6
Walter Roberson
2011년 1월 21일
A couple of months ago, I read a simple proof that there are as many formulas that can be integrated as there are that cannot. Generate a random expression from components each of which are individually differentiable; through the chain rule, the overall formula will be differentiable. The coefficients possible for those formula include the continuous reals, so there are there will be Aleph One such differentiable formulas, and each of the differentials is a formula that can be integrated. As there is no known infinity larger than Aleph One, there cannot be a larger infinity of formulae that cannot be integrated.
Although this proof of relative numbers is clear, still there are a large number of formulae that are "interesting" to us that there is no way to integrate. That is partly, though, because the ones that are easy to integrate tend to stop being "interesting".
connie
2011년 1월 21일
Christopher Creutzig
2011년 1월 25일
As Walter already pointed out in his answer, your subs call is not doing anything, since you simply discard its result. subs(a, whatever) does *not* change a as a side-effect. Not seeing f1 through f4, it's difficult to say more. (If you wish to give them, please try editing your question, that would be much easier to read.)
Christopher Creutzig
2011년 1월 25일
@Walter: The number of formulas which can be written in finite length over a finite alphabet that is integrable is, of course, countably infinite and therefore as large as the set of all such formulas. But even without a formal proof, I'm pretty confident that, given a “randomly chosen” enumeration of these formulas, the asymptotic density of formulas integrable in finite terms would be small, probably zero, almost surely. Differentiating a randomly selected formula very often results in a much larger one.
Walter Roberson
2011년 1월 25일
What is a "formula integrable in finite terms" ? It is not uncommon for the integration of formulas involving rational constants to result in irrational numbers that we do not happen to have a finite name for.
Christopher Creutzig
2011년 1월 26일
At least for anything that comes anywhere close to Liouvillian field towers, the only constants required are algebraics, and we have names for them, as in sum(b*ln(...), b in RootOf(...)).
A “formula integrable in finite terms” is a formula f where there is, in the notation we use (the term obviously depends on that notation), a formula g such that g'=f. If such a g would require constants that cannot be represented, f is not integrable in finite terms.
But I'm not sure I see how to construct such an f, especially given that I'd happily accept finite-length descriptions involving infinite sums etc. for the constants, since they are part of the CAS vocabulary.
카테고리
도움말 센터 및 File Exchange에서 Special Values에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!