I've got some problems solving (numerically) this system of equations.\begin{array}{l}40 \cdot \cos (2t) + 105 \cdot \cos ({\theta _3}) - 75 \cdot \cos ({\theta _4}) - 91.924 \cdot \cos ({337.62}) = 0\\40 \cdot \sin(2t) + 105 \cdot \sin({\theta _3}) - 75 \cdot \sin({\theta _4}) - 91.924 \cdot \sin({337.62}) = 0\end{array}Now t is an array of numbers (variable?) ranging from 0 to 0.785 like this t = 0:0.01:0.785.I was wondering if it is possible to find $\theta_3$ and $\theta_4$ for every t (like t=0 --> $\theta_3$=something, $\theta_4$=something...t=0.4-->$\theta_3$=something else, $\theta_4$=something else) put those values(solutions) in an array (vector)so that I can plot them.I've tried to do it symbolically with solve but MATLAB couldn't find any (useful) solution. I tried to solve it numerically but I couldn't make it spit out more than two solutions at a time.I've done it in Mathcad but I need to solve this with MATLAB (I'm new to MATLAB).
System of nonlinear equations in MATLAB
matlab;nonlinear equations;nonlinear algebra
I would loop over t and solve the system using the fsolve command. For $t=0$, it shouldn't be too difficult with a reasonable initial guess. And then solve each problem using as initial value the solution of the previous value for $t$...Define your function asfunction [res] = problem(x,t)t1 = 337.62/180.0*pi;t3 = x(1);t4 = x(2);res = zeros(2,1);res(1) = 40.0*cos(2*t)+105*cos(t3)-75*cos(t4)-91.924*cos(t1);res(2) = 40.0*sin(2*t)+105*sin(t3)-75*sin(t4)-91.924*sin(t1);return;Define the values of the parameter:t = [0:0.01:0.785] Make room for the solutions:sols = zeros(2,length(t))Solve for $t=0$ with an initial guess of $\theta_3 = \theta_4 = 1$ (arbitrary)theta0 = [1,1];sols(:,1) = fsolve(@(x) problem(x,t(1)),theta0)And then loop over the remaining values for $t$ using the previous solution as initial guess:for i=2:length(t),  sols(:,i) = fsolve(@(x) problem(x,t(i)),sols(:,i-1))endand plotplot(t,sols(1,:),t,sols(2,:))Caveat: my Matlab is a bit rusty (my switch to Python/Numpy/Scipy is already a couple of years ago...)