You have 8 constraints, so you need a polynomial with 8 coefficients, which is a 7th degree polynomial. So construct
syms c1 c2 c3 c4 c5 c6 c7 c8
syms x
Y = sym('x->c1*x^7+c2*x^6+c3*x^5+c4*x^4+c5*x^3+c6*x^2+c7*x+c8');
Now let the constraint values be C01, C02, C11, C12, C21, C22, C31, C32 -- which I numbered with the continuity order as the first digit and the second digit is 1 for "a" and 2 for "b".
syms C01 C02 C11 C12 C21 C22 C31 C32
Now we make use of the symbolic operator D to express the constraints: ics = '{Y(a)=C01,Y(b)=C02,D(Y)(a)=C11,D(Y)(b)=C12,D([1,1],Y)(a)=C21,D([1,1],Y)(b)=C22,D([1,1,1],Y)(a)=C31,D([1,1,1],Y)(b)}';
and expand the polynomial function and allow the D expressions to be evaluated:
eqnsys = simplify(subs(ics,'Y',Y));
And what we have left is a simple system of equations that we can solve() for:
S = solve(eqnsys,C01,C02,C11,C12,C21,C22,C31,C32);
SS = structfun(@simplify, S, 'Uniform', 0);
And now you will have SS.c1, SS.c2 and so on, in symbolic form, expressed in terms of C01, C02, etc.
Best Answer