I have not used a python but the mathematical equation is not able to solve which I am trying to solve I am I am trying to solve the variables "a" of the following equations where s, c, mu, and delta t parameters are known.
I used to write NSolve in mathematics, Solve, etc., but it is running for an hour with no luck. Since I'm not familiar with Python, is there any way I can use Python to solve this equation? "post-text" itemprop = "text">
You are not looking for an analytical solution for these equations because they are transcendental, in which a I think the problem is with numerical solutions, that the limit of acceptable values for In Python, you can get a zero of your third equation (form Edit: The way a is interrupted by
arcsin since
Arcsin is defined for arguments between only -1 and 1 (believe that you should be
a ),
alpha for your code Code> and
beta require
a & gt; S / 2 and
A & gt; (Sc) / 2 .
f (a) = 0 )
brentq function: import as sipy.optimize np from copy as import. Brent = 10014.6 c = 6339.06 mu = 398600.0 dt = 780.0 def f (a): alpha = 2 * np.arcsin (np. Sqrt (s / (2 * a)) beta = 2 * np.arcsin (np.sqrt ((sc) / (2 * a)) alpha-beta - (np sin (alpha) -npsin (beta) ) - NP SCRT (MU / A ** 3) * DT A = Maximum (S / 2, (SC) / 2) A = Brentac (F, A, 10 * A0)
brentq (f, a, b) is to clarify the tasks that it searches for
f zero at one interval
[A, b] . Here, we know that
a is less than
maximum (S / 2, (S-C) / 2) . I guessed that it was a high upper limit 10 times, and it worked for the given parameters. More generally, you need to make sure that the change in
f happens between
a and
b and you can read more about this How that works in the function.
No comments:
Post a Comment