Hey,
I have three simultaneous equations which I have been using to solve with fsolve. There is a constant, B, in these equations which so far I have been manually setting to the desired number needed, however, this method is extremely inefficient.
What i want to be able to do is set this variable to be an array between 1/3 and 3 with an increase of 0.01 between elements, and have fsolve solve for each element in the array.
The three equations are:
F(1)=(B.*u(1))+(B./(u(2)-u(1))^2)+(B./(u(3)-u(1))^2);
F(2)=u(2)-(B./(u(2)-u(1))^2)+(1/(u(2)-u(3))^2);
F(3)=u(3)-(B./(u(3)-u(1))^2)-(1/(u(3)-u(2))^2);
where B is the array I wish to use, with B=[(1/3):0.01:3].
I am wondering if it is possible to run this so that I can have an array for each variable I want u1, u2 and u3? I am stuck because I am not sure what to do when setting the initial conditions for fsolve, as these would probably also have to be set in an array. I hope this description is sufficient enough for you to understand. Thankyou
Best Answer