I need to solve a two-dimensional system of equations. I have a column-vector, named here "SpreadCLPbp" with N=length(SpreadCLPbp)=500.
I want to solve:
0 = sum_{i=1}^{N}{(-1/mu2 +exp(mu2*delta)/mu2)*(SpreadCLPbp(k)-(-mu1/mu2+(mu1/mu2+SpreadCLPbp(k))*exp(mu2*delta)))/(mu1*sigma/(2*mu2^2)-sigma^2/mu2*(mu1/mu2+SpreadCLPbp(k))*exp(mu2*delta)+sigma^2/mu2*(mu1/(2*mu2)+SpreadCLPbp(k))*exp(2*mu2*delta))}0 = sum_{k=1}^{N}{(mu1/mu2+delta*exp(mu2*delta)*(mu1/mu2+SpreadCLPbp(k))-exp(mu2*delta)*mu1/mu2)*(SpreadCLPbp(k)-(-mu1/mu2+(mu1/mu2+SpreadCLPbp(k))*exp(mu2*delta)))/(mu1*sigma/(2*mu2^2)-sigma^2/mu2*(mu1/mu2+SpreadCLPbp(k))*exp(mu2*delta)+sigma^2/mu2*(mu1/(2*mu2)+SpreadCLPbp(k))*exp(2*mu2*delta))}
I tried to do the following
syms k mu1 mu2;S1 = symsum((-1/mu2 +exp(mu2*delta)/mu2)*(SpreadCLPbp(k)-(-mu1/mu2+(mu1/mu2+SpreadCLPbp(k))*exp(mu2*delta)))/(mu1*sigma/(2*mu2^2)-sigma^2/mu2*(mu1/mu2+SpreadCLPbp(k))*exp(mu2*delta)+sigma^2/mu2*(mu1/(2*mu2)+SpreadCLPbp(k))*exp(2*mu2*delta)),1,N);S2 = symsum((mu1/mu2+delta*exp(mu2*delta)*(mu1/mu2+SpreadCLPbp(k))-exp(mu2*delta)*mu1/mu2)*(SpreadCLPbp(k)-(-mu1/mu2+(mu1/mu2+SpreadCLPbp(k))*exp(mu2*delta)))/(mu1*sigma/(2*mu2^2)-sigma^2/mu2*(mu1/mu2+SpreadCLPbp(k))*exp(mu2*delta)+sigma^2/mu2*(mu1/(2*mu2)+SpreadCLPbp(k))*exp(2*mu2*delta)),1,N);S = solve([S1 == 0, S2 == 0],[mu1, mu2])
But I get the following error
Error using sym/subsindex (line 732)Invalid indexing or function definition. When defining a function, ensure that the arguments are symbolic variables andthe body of the function is a SYM expression. When indexing, the input must be numeric, logical, or ':'.Error in analisisdatoscir (line 42)S1 = symsum((-1/mu2+exp(mu2*delta)/mu2)*(SpreadCLPbp(k)-(-mu1/mu2+(mu1/mu2+SpreadCLPbp(k))*exp(mu2*delta)))/(mu1*sigma/(2*mu2^2)-sigma^2/mu2*(mu1/mu2+SpreadCLPbp(k))*exp(mu2*delta)+sigma^2/mu2*(mu1/(2*mu2)+SpreadCLPbp(k))*exp(2*mu2*delta)),1,N);
If someone could help me I would be very grateful. Watch for answers. Greetings.
Best Answer