Using fsolve to solve non-linear equations

  Рет қаралды 47,901

Dr Gregory Reeves

Dr Gregory Reeves

9 жыл бұрын

In this screencast, we go over a chemical engineering example of using Matlab's fsolve to solve for unknown composition, molar flow rates, and temperature in a system of non-linear equations associated with a condenser.
To achieve a higher selectivity of C with respect to D, you would like to have a smaller reactor. This is because over time, C will degrade into D (A + C goes to D), and in a larger reactor, the components spend a longer time in the reactor, allowing for more time for this degradation process to take place. A smaller reactor will have time to make C, but not as much time for that to change into D.

Пікірлер: 20
@emlmm88
@emlmm88 6 жыл бұрын
Wow, it's uncanny. This is almost the exact problem that our ChemE professor gave us and was giving me so much trouble. Thank you!
@annicafreytag1216
@annicafreytag1216 8 жыл бұрын
Thank you so much! This is great. Helped me a lot!
@priyajeni5560
@priyajeni5560 2 жыл бұрын
sir is it possible to solve the below type of equations using fsolve... if it is how to give an input in MATLAB? A1=(1+1/beta)D^2+diag(f+g)D-2h*I B1=2p^2 where beta=0.8 c=0.3 Initial guess is f(0)=1-e^(-n) g(0)=c*(1-e^-n) p(0)=e^(-n) h(0)=c*e^(-n) This is Spectral collocation method...i have no idea to give input as matrix form... pls kindly help..
@drgregoryreeves
@drgregoryreeves 2 жыл бұрын
Hi Priya, I am having a hard time determining what your question is. So it looks like you have two equations and four unknowns? I don't remember if fsolve can work with underdetermined systems. Do you have other constraints you can work with? To put your two equations into matrix form, the last line of your function m-file can be F = [A1; B1], and then the output of the function m-file should be "F". That function m-file will also expect a vector of your unknown variables as the first input (call it "Y"). So in the first few lines of the m-file, you will need to say something like: f = Y(1); g = Y(2); p = Y(3); h = Y(4);
@HUNDANOL
@HUNDANOL 7 жыл бұрын
This is very helpful. Thanks! Can you suggest me a book that describes fsolve. I am using fsolve for much complicated system of equations, more than 200 equations and for different parameter values.
@Perspective8847
@Perspective8847 7 жыл бұрын
Thanks for the video. It's very close to what I'm looking for, i would like you to help me out. I'm working on alloys and need to calculate the value of a parameter that has 3 variables that are also equations, the parameter and one of the variables have 4 variables that i need to afterwards vary to get the values of the parameter over a range of concentration fitting experimental curve
@olawalebello7593
@olawalebello7593 4 жыл бұрын
Hello, I wish you could solve similar problem with six unknown parameters using "lsqnonlin function"
@doc_microscope
@doc_microscope 6 жыл бұрын
Good afternoon, i have a problem: I have this linear system of 4 equations in four unknows P1, P2 P3 and P4: a1*P1+a2*P2+a3*P3+a4*P4=a; b1*P1+b2*P2+b3*P3+b4*P4=b; c1*P1+c2*P2+c3*P3+c4*P4=c; d1*P1+d2*P2+d3*P3+d4*P4=d; a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4,d1,d2,d3,d4 are constants and a,b,c,d are the known terms. How i can implement it on Matlab such that to find the roots?
@doc_microscope
@doc_microscope 6 жыл бұрын
It isn't linear equations. The equations are these: G1=10log10(P_out1/Pin1)=10log10exp( a1*P1+a2*P2+a3*P3+a4*P4-a) G2=10log10(P_out2/Pin2)=10log10exp(b1*P1+b2*P2+b3*P3+b4*P4-b) etc. Is it possible approximate the logarithm in these manner? 10log10(P_out/Pin)=10log(e)*( a1*P1+a2*P2+a3*P3+a4*P4-a) such that i can to obtain a linear system?
@rishijaiswal1354
@rishijaiswal1354 6 жыл бұрын
Why is there a dot in 10^.(A-B/C+T)?
@rishijaiswal1354
@rishijaiswal1354 6 жыл бұрын
Thankyou very much!
@FcoJRueda
@FcoJRueda 7 жыл бұрын
What's the book?
@FcoJRueda
@FcoJRueda 7 жыл бұрын
Where it is written all the exercises? Ahhhhh and where can I find that document?
@fangirl8864
@fangirl8864 4 жыл бұрын
Sir, how could we solve non linear equations of two variables let's say equations -x1+2x1^3+x2=0,-x1-x2=0
@GregReeves1520
@GregReeves1520 4 жыл бұрын
sorry, the notification about your message went to my spam box, for some reason. I have to say I am not totally sure what you're asking. If you follow the fsolve example above, but input your two equations instead of the ones used in the example, you should be able to solve them. Alternatively, from looking at your equations, the second equation is x1 = -x2, so you should be able to substitute that relationship into the firs equation and get a cubic, which you can solve analytically or numerically very easily with Matlab's "roots" function.
Using fsolve with parameters
8:32
Dr Gregory Reeves
Рет қаралды 14 М.
The basics of fsolve
12:49
Dr Gregory Reeves
Рет қаралды 19 М.
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37
1 or 2?🐄
00:12
Kan Andrey
Рет қаралды 58 МЛН
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 45 МЛН
THE POLICE TAKES ME! feat @PANDAGIRLOFFICIAL #shorts
00:31
PANDA BOI
Рет қаралды 25 МЛН
MATLAB Nonlinear Optimization with fmincon
14:26
APMonitor.com
Рет қаралды 238 М.
Solving Equations with MATLAB using fsolve
21:17
purdueMET
Рет қаралды 7 М.
Solving ODEs in MATLAB
25:22
Vincent Stevenson
Рет қаралды 27 М.
Solve Nonlinear Systems of Equations in MATLAB - fsolve()
8:33
Aleksandar Haber
Рет қаралды 12 М.
MATLAB Solvers
8:25
LearnChemE
Рет қаралды 95 М.
Linear vs. non-linear least squares - Michaelis Menten
11:03
Dr Gregory Reeves
Рет қаралды 37 М.
Setting Options for Optimizations
4:53
MATLAB
Рет қаралды 7 М.
How to Solve System of Equations in MatLAB - 2x2 and 3x3
6:38
Kindson The Genius
Рет қаралды 31 М.
Как распознать поддельный iPhone
0:44
PEREKUPILO
Рет қаралды 1,9 МЛН
😱Хакер взломал зашифрованный ноутбук.
0:54
Последний Оплот Безопасности
Рет қаралды 757 М.
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 36 МЛН