Root Finding in Python
Learn how to numerically find roots of complex equations in python. Script can be found here: https://www.hageslab.com/Resources.ht... Here we are using "Spyder" IDE with the numpy, scipy, and matplotlib libraries Script: import numpy as np import matplotlib.pyplot as plt from scipy.optimize import fsolve Arbitrary Example def fxn1(x): return x**2+3*x - np.exp(x**(1/2)) xlist = np.linspace(0,1,num=1000) plt.figure(num=1,dpi=120) plt.plot(xlist,fxn1(xlist),label="Fxn1") plt.plot(xlist,xlist*0,"--",label="y=0") plt.legend() root = fsolve(fxn1,0.5) def fxn2(Ts, Tinf, Ti, A, Rtot, h, eps, sigma=5.67e-8): # SI units return (Tinf - Ti)/(A*Rtot) - (h+eps*sigma*(Ts+Tinf)*(Ts**2+Tinf**2))*(Tinf-Ts) Tlist = np.linspace(283.15,308.15,num=1000) plt.figure(num=2,dpi=120) plt.plot(Tlist,fxn2(Tlist,283.15,308.15,1.8,0.25,2,.95),label="Fxn2") # SI units plt.plot(Tlist,Tlist*0,"--",label="y=0") plt.legend() Ts = fsolve(fxn2,290,args=(283.15,308.15,1.8,.25,2,0.95)) # [K] Ts_C = Tsf-273.15 # [C]

How to: Plot a Function in Python

How to: Solve an ODE in Python (Boundary Value Problem)

Python Integration, Interpolation, and Curve Fitting

How to: Import, Plot, Fit, and Integrate Data in Python

Lambert W Function (domain, range, approximation, solving equations, derivative & integral)

Kronig-Penny Solution in Python

Monte Carlo Integration In Python For Noobs

But what is a Laplace Transform?

How to: Make a Polar Plot in Python

6. Monte Carlo Simulation

Machine Learning for Everybody – Full Course

The Strange Math That Predicts (Almost) Anything

The Ising Model in Python: Statistical Mechanics and Permanent Magnets

How to: Numerical Derivative in Python

Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

Solve Equations with SymPy! Python Basic Algebra Tutorial

Optimize with Python

How I animate 3Blue1Brown | A Manim demo with Ben Sparks

Introduction to Binary Search (Data Structures & Algorithms #10)

