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 x1subs(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);
Best Answer