Hey guys!
I,m quite new to matlab.
I have a system of four nonlinear equations for which I want to plot the results as a function of a variable. Can anybody help me on that?
function F = myfun(x)w1 = 1;w2 = 3;a1 = -24.851;a3 = -66.319;a2 = -9.247;a8 = -345.019;a4 = 0;a6 = -66.319;a5 = -3.082;a7 = 0;mu1 = 0;mu2 = 0;f1 = 0;f2 = 0;S1 = 1;S2 = 0.01;F = [ 8 * w1 * mu1 * x(1) - a2 * x(1)^2 * x(2) * sin(x(3)) - 4 * f1 * sin(x(4)); 8 * w2 * mu2 * x(2) + a5 * x(1)^3 * sin(x(3)); 8 * w1 * x(1) * S2 + (3* a1 * x(1)^2 + 2 * a3 * x(2)^2) * x(1) + a2 * x(1)^2 * x(2) * x(2) * cos(x(3)) + 4* f1 * cos(x(4)); 8 * w2 * x(2) * (3 * S2 - S1) + (3 * a8 * x(2)^2 + 2 * a6 * x(1)^2) * x(2) + a5 * x(1)^3 * cos(x(3))];end
Here is my code. the unknowns are x(1),x(2),x(3) and x(4). What I want is:
- Solve the nonlinear system and show the answer.
- Plot x(1) vs S1 parameter as S1 changes from -50 to 50.
Is this possible to do in matlab?
Thanks in advance.
Best Answer