Unfortunatly, I'm stuck. In a previous question, I asked about a possibility to do a comparison of coefficients within a symbolic function. The tricky part seems to be (at least I think it is) that the function consist of a initial function as I have documented below. In the end, Im trying to receive a system of equations from every comparison of coefficients.
This is the code so far:
coeffs = [sym('a0') ,sym('a', [1 2]), sym('b', [1 2])];
trigs = [cos([1 2]*sym('tau')), sin([1 2]*sym('tau'))];
initFC = symfun(sum([1 trigs] .* coeffs), [coeffs sym('tau')]);
So that is my final inital function. Let me put that in any equation, e.g.
F([coeffs sym('tau')]) = initFC.^2 == 0;
I can subs() any of the symbolic variables, superb! After expanding(F), combine(F, 'sincos') I receive a term that consists only of trigonometric terms:
F = expand(F);
F = combine(F, 'sincos')
Now here is the problem: I need to substract the coefficients of this equation for e.g. cos(tau), cos(2*tau), ... .
I did like someone recommended before:
sym Z
F = subs(F, trigs(1), Z)
Error using symfun/subsindex (line 157)
Indexing values must be positive integers, logicals, or symbolic variables.
I also tried collect:
collect(F, Z)
(2*a0*a1 + a1*a2 + b1*b2)*Z + (a1^2*cos(2*tau))/2 + ...
which is almost the solution which I'm seeking but there are still remaining parts of the equation within the output that I cant remove.
The final system of equations should look like this:
[2*a0*a1 + a1*a2 + b1*b2;
...
...
...