Ask Your Question
1

Simple trigonometric equation solving

asked 2021-01-14 14:46:37 +0200

vladimir42000 gravatar image

updated 2021-01-27 00:00:47 +0200

slelievre gravatar image

I was a MapleV user in the past (~25 years ago) an I'm very pleased to find such an elegant solution the sage is. I try to see how it works trying to solve an easy trigonometry calculation:

var('r,l,m')
ex = l/sin(m/2/r)-r 
solve(ex,r) 

[r == l/sin(1/2*m/r)]

Do not want, ok. To simplify I put some real values m and l and tried again:

exval = ex.subs(l=7.2,m=10)
solve(exval,r)

[r == 36/5/sin(5/r)]

still not solving, r=3.68357 is what I'm searching for. What would be a right way to proceed? Thank you in advance, v42

edit retag flag offensive close merge delete

Comments

Due to mis-reading the question, I inadvertently left here a pile of manure...

My apologies to whomever I may have misled.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2021-01-14 17:02:24 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-01-15 00:39:51 +0200

Emmanuel Charpentier gravatar image

updated 2021-01-15 00:40:37 +0200

This plot :

var('r,l,m')
ex = l/sin(m/2/r)-r
plot(ex.subs(l=36/6, m=10), (r, -5, 5), ymin=-5, ymax=5, detect_poles=True, plot_points=1000)

suggests that ex has no (real) roots around 0. Proving it may require a non-trivial analytical exploration, possibly requiring the non-trivial use of non-trivial tools...

However, trying the suggested numerical solution :

print("Value of ex at suggested root r=%f is %f"%(3.68357, ex.subs([l==36/5,m==10]).subs(r==3.68357)))
Value of ex at suggested root r=3.683570 is 3.683570

suggests a typo in the question : at this value, ex approximately equals r. Which suggests that this value is (ano approximation of) a root of ex-r, which can be found more elegantly by :

print("Root of ex-r : %f"%find_root(ex.subs(l=36/5, m=10)-r, 2, 5))
Root of ex-r : 3.683570

See plot and computations in Sagecell

edit flag offensive delete link more

Comments

Dear Emmanuel, Thank you a lot for your reply and explanation, this is what I tried to achieve. You're right with ex - r. Thanks again, I pursue my exploration of this superb piece of software :).

vladimir42000 gravatar imagevladimir42000 ( 2021-01-15 17:58:56 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-01-14 14:46:18 +0200

Seen: 63 times

Last updated: Jan 27