0:00 "What's going on, smart people!" - There. That's where you lost me. 😀 Just kidding. Nice video. I didn't know about the latex trick. Thank you for sharing.
You've made a typo in your first system of equations. You wrote: eq2 = Eq(3*x-1,-2) It should be: eq2 = Eq(3*x - y, -2) The first system yields x = -1/3 (3x = -1 => x = -1/3) and thus y = 11/3 The second system yields x = 2 and y = 8. Hope that helps!
Andrew you just made my day . I was on rank 7 in code chef contest and used this method to solve the equation of degree 4 and got the 4th rank. Love you bro ❤
Thanks for the video. I was looking for an easy way to find the initial guess for a poly nomial in order to solve the equation by fsolve from scipy.optimize and importing numpy!
Nice video. Since this video is over a year old, you may have figured this out by now. Using control-Enter is the same as having to move your mouse to click on run.Use that for about 10 minutes and it will become instinct. The little bit of time saved can add up over a long coding session.
Have you tried the "Successive Over-Relaxation" method? It's an iterative method with a convergence parameter, it solves large matrices MUCH faster than Gauss-Jordan does. When you get to doing Finite Difference Methods with grids in the millions, that performance matters!
Dear Andrew Dotson, Thank you for your video. Most helpful. I was wondering if, perhaps, you could post some tips/techniques for evaluating the stability of ODE using Python. Recently, there has been great development in that field using Python. One example is the LMFIT Python's library, which is most straitfoward for modelling linear and non-linear syatems. Nevertheless, we still lack a proper method for evaluating stability in an ODE system.
It's easy to figure out most of the time. The equilibrium points are wherever the vector *y'* = *0* which for ODEs quadratic in *y* can be solved similarly to the method shown here. Then for stability if I remember correctly you linearise the system around the equilibrium points to obtain an equation *y'* = *Ay* And then you find det *A* , Tr *A* and follow this diagram: en.m.wikipedia.org/wiki/Stability_theory#/media/File%3AStability_Diagram.png
thx for video i need to solve problem it look easy but it isn't i wanna use sympy or numpy honestly it dosn't matter any thing that solves it my equation has one variable but one is one side and the other is on other side and it wont come to other side easily cause it buried under 4 or 5 heavy Denominator so is there a way i can solve this ? if u know how plz help me ps: i will bookmark this page to look for your answers
weigeng peng I would say learn the basics of cpp, and than you can move on quickly. If you don't know much about programming, python is like black magic, I don't think one could understand what's going on behind the scenes. However, in cpp you can see all the steps.
I agree with Zoltan. C++ taught me what exactly was going on behind the scenes, and python taught me that maybe I don't need to specify every little semi colon to know what I'm doing.
cpp - you will learn a lot about computers, and how they work under the hood. However, you will also discover that even simple things take a long time to code, and the learning curve will be quite steep. Python is a beginner friendly language, which allows you to focus on the logic of your program, and does many things in the background that you don't need to worry about, which makes code development fast, much faster than C. If you have no programming experience, I would recommend Python first, and then - if you still need to dive deeper - you could always learn cpp. C libraries can be imported into Python as modules, so it is possible to 'combine' both languages - Python for high-level abstraction and cpp for code execution speed. It's not uncommon these days to write a prototype of a programme in Python, test the logic, see how it works, debug, and then rewrite the final version in cpp. Anyway, if you think seriously about studying physics, make sure you learn maths first - this is the ultimate foundation of physics and IT!
if you have Anaconda installed there is nothing you need to do. Both Numpy and Sympy (and many oyher packages) are already preinstalled. Just open your jupyter notebook and import them as in this tutorial.
Do You know the trick to add space between variables in latex if I use it? Example "a, b = sp.symbols('a b'); a*b; will give "ab". So I prefer "a b". I have a solution : "a, b = sp.symbols('a~ b~'); but do You know something better ?
Hello Andrew Dotson!😇 I've been struggling with running codes in python? After I watched your video, maybe you can help me to complete my homework which is all about Systems of Nonlinear Equation? I wish you would notice me. 😊 Godbless you and your youtube channel. More power to you.😇💯
Hm... Can we really say that SymPy and NumPy are equivalent when it comes to solving equations? One is based on symbolic algebra and the other one does calculations on raw numbers. Simple equations, where we already know the solution algorithm, can be solved with NumPy. Non-linear systems, where no variable or constant matrices may be easily defined, rely on SymPy. Also, SymPy non-linear solvers (numeric methods) are much more refined than NumPy. I would suggest using NumPy for complex math and array operations (also consider that NumPy is compatible with Numba - and may run with machine code speed), and relying on SymPy to solve equations where necessary.
x=3 y=-1 g=Matrix([[x],[y]]) for i in range(len(g)): for k in range(0,3): d=g[[x],[y]] - j_inv[[x],[y]]*F[[x],[y]] g[[x],[y]]=d[[x],[y]] print(d) ################################### Hello there, i need to fill the equation in the for loop with the ( [x and y values] of the matrix g at each iteration) at the second loop iteration the value of the equation of d(which should became a matrix after the first loop result) needed to replace the values(3,-1) of g. Finally, i need to do this process 3 times and print a schedule of x and y values at each iteration how do i do it
I'll keep that in mind next time. I wasn't thinking about someone not using fullscreen when I made the video, but of course people wouldn't be using full screen.
Thanks for the reply, Andrew. Actually, I watch your videos on my phone and thus even when I go full screen, I have to look closely. I thought that there may be other people like me who have small sized mobile devices. So, I thought to mention that once.
Hey someone know how to put initial conditions to calculate 𝐶1 and 𝐶2, and how to plot results, from sympy.interactive import printing printing.init_printing(use_latex=True) from sympy import * import sympy as sp x = sp.symbols('x') f = sp.Function('f')(x) diffeq = Eq(f.diff(x,x) -5*f,x) # initial condition f0 = 5 # time points x = np.linspace(0,20) display(diffeq) dsolve(diffeq,f)
Shut up, Ryan Reynolds. I can't focus on the math. (EDIT: Ah, well, I should have known I wasn't going to be the only person to say that. Still, though. You could pass as his more serious cousin, Bryan Reynolds.)
useless, looking for trigonometric system of equations, not a simple linear one which can be found all over the internet. Really no need for a dragged out 15 minute video on it
If you already know how to solve the linear systems, then you wouldn't look up the video in the first place. To others it's not dragged out, it's thorough. Sorry it wasn't what you were looking for.
@@AndrewDotsonvideos I didnt look up how to solve linear equations, I searched for trigonometric ones and your video came up first as your title is called "Systems of Equations" which can mean both linear and complex ones, I had no Idea until I watched it you was just using generic 'linear' examples. Im needing to solve for x and y in the equations, tan(x) - y = 0 cos(x) - 3sin(y) = 0 Also youre videos aren't useless, ive watched many in the past, that was just spur of the moment frustration as i've been trying to crack this question for serveral hours now and no luck. Not sure if im missing something or what.
Hey someone know how to put initial conditions to calculate 𝐶1 and 𝐶2, and how to plot results, from sympy.interactive import printing printing.init_printing(use_latex=True) from sympy import * import sympy as sp x = sp.symbols('x') f = sp.Function('f')(x) diffeq = Eq(f.diff(x,x) -5*f,x) # initial condition f0 = 5 # time points x = np.linspace(0,20) display(diffeq) dsolve(diffeq,f)