- You have three symbolic variables; you should be naming your variable of summation specifically.
- In MATLAB, symsum is for the case where the variable of summation is used in the calculation, not to add a definite list of terms. You should create a vector of terms and add them with sum(), or create a total using a loop. Using arrayfun() can help:
t1 = arrayfun(@(k) ((-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, 'Uniform', 0);
S1 = sum( horzcat(t1{:}) );
- solve() is for analytic solutions, when you need the result to be the formula for the solution. Your chances of being able to find the exact formula for this with your available resources are pretty minimal. You should consider using vpasolve() to get a symbolic numeric solution; or you should consider using matlabFunction() and fsolve() to get a pure numeric solution.
Best Answer