Python Nonlinear Equations with Scipy fsolve

preview_player
Показать описание
The Scipy optimization package FSOLVE is demonstrated on two introductory problems with 1 and 2 variables.
Рекомендации по теме
Комментарии
Автор

Thank you so much prof. Your lesson very good

thaeermsahib
Автор

This is helpful thank you .. Instantly subscribed!

nmana
Автор

Dear APMonitor

Thank you for uploading these videos. I have learn't a great deal from them. I am trying to find out if you would know how to solve for the nonlinear equations over a range of coefficients.

ax^2 + ax + c = 0

where a & c are coefficients.

Thus solve for x over the range of a: a = 0:5:1000?

matthewerasmus
Автор

fsolve is very sensitive to initial guess.is there any other way to find root where we can find the root easily?

KazuyaKunXD
Автор

Thanks for sharing! If I have a function which could have anywhere from 1 to 4 solutions, depending on some input parameters, and I want to return all of the solutions, is there a way to do this? I.e. without going through them one at a time, but instead returning a list or array of each of the 1, 2, 3 or 4 solutions?

daniel_johnson_pmbpk
Автор

Good night, it's me again here from Brazil.
I am trying to find two points of intersection between a circle, a line and a parabola, all curves in the plane. There are 3 equations with 2 variables.
However, I would like your help to answer a question:
- to solve the system I had to put the Z axis in the fsolve. The answer should be zero. Why is it different from zero?
- Why, depending on the initial value that I put in fsolve, can he find the point of intersection between 2 curves and not 3?
I will send my code.
Note that for the initial palpilte (-3, -3, -20)) the answer is [-1.9 -0.9], which is the point of intersection between the circle and the parabola and not between the circle, parabola and the line.

import numpy as np
from scipy.optimize import fsolve

def equations(p):
X, Y, Z = p
y1 = X-Y**2 +3 # parabolic
y2 = X+Y+1 # line
y3 = X**2+Y**2-5 # circle
return (y1, y2, y3)

X, Y, Z = fsolve(equations, (-3, -3, -20))

print(np. around((X, Y), 2), Z)
# Why the solution is just parabolic and circle? Why Z is not 0?


I would appreciate it if you could help me.

Luciana

tecnologia_em_pauta
Автор

Hi, thanks for sharing. I have one question though. @5:23:
plt.plot(x, f(x))
plt.plot(x, np.zeros(len(x)))


Why did we plot 'x' twice?
Or is it something else that is happening?
Thanks

shreeniketjoshi
Автор

Hi Professor, These are great videos, where can i find the videos for other homework?

kathytang
Автор

I have a problem with fsolve, sometimes it returns bad solutions I don't know why.
I'm solving a function that has a parameter in a loop and it starts out very well, but at some point it returns bad solution eventhough I raise maxfev and lower xtol, what should I do ?

Thefv
Автор

When I am trying to solve a integral function. It appears: RuntimeWarning: The number of calls to function has reached maxfev. Can I solve it?

frankelindddd
Автор

What is the error of the fsolve solutions?

czachA
Автор

How can i use dependents equations (diffrential equations) using fsolve ?

ruanfreitas
Автор

Can you kindly show how to plot the graph of the two nonlinear systems?

SANAGHUS
Автор

sorry, where is the video for problems 3 and 4??

Mythias
welcome to shbcf.ru