fsolve - How do I input known variables and still make a guess at the unknown variables in fsolve?
Show older comments
Hi,
I am working with 6 highly non-linear equations in which I define two variables (A1 and A2), input 4 variables from the previous timestep (B1 -> B4), and using the fsolve command, have a guess at 6 values, 4 of which will become the new B1->B4 values for the next timestep (C1->C4), and 2 which I am actually interested in (D1 D2).
I have my code in the form:
function EoM = myfun(...) % the inputs to this are numerous and not all of them will be guessed, some are in the form of arrays
% Define a series of coefficients and use them with the inputs to determine the equations to be used by fsolve
EoM = [/*some function including A1, A2, B1, B2, B3, B4, C1, C2, C3, C4, D1, D2*/;...
/*another function including A1, A2, B1, B2, B3, B4, C1, C2, C3, C4, D1, D2*/;...
. ;...
. ;...
. ;...
/*the final equation*/];
end
Guess = [C1 C2 C3 C4 D1 D2]
Ouput = fsolve(@myfun,Guess)
if true
% code end
I guess my question is, will this work or will fsolve be looking for guesses at the other values?
cheers for any help
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!