|
Hi I am trying to solve an equation (to eventually put in a loop). However, after I take care of the differentiating, I cannot replace the symbols with actual numbers. Could someone please help me?
Here is what my m file looks like:
syms u1 u2
f = [(u1^3) - u2; (u2^3) - u1];
u = [u1;u2];
J = jacobian(f,u);
Ji = inv(J);
b = Ji*f;
u1 = 2;
u2 = 1;
u = u - b
my result for "u" is:
u =
u1 + (u1 - u2^3)/(9*u1^2*u2^2 - 1) + (3*u2^2*(u2 - u1^3))/(9*u1^2*u2^2 - 1)
u2 + (u2 - u1^3)/(9*u1^2*u2^2 - 1) + (3*u1^2*(u1 - u2^3))/(9*u1^2*u2^2 - 1)
I want matlab to replace all u1s with 2 and all u2s with 1. I have been searching for the past couple of hours and have not found anything. It doesn't seem like it is too hard but I just cant figure it out!
Thanks!
|