# How can I solve it ?? Help please

1 view (last 30 days)
Melika Eft on 5 Nov 2020
Commented: Melika Eft on 5 Nov 2020
How can I solve this Equation Sin(2t)-3t=3t-cos(t) without using ((solve)) Thank you

KSSV on 5 Nov 2020
syms t
eqn = sin(2*t)-6*t+cos(t)==0 ;
s = solve(eqn,t)
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
s =
0.23845729337266814001123439439291

VBBV on 5 Nov 2020
% if true
% code
%end
syms t
S = vpasolve(sin(2*t)+cos(t)-6*t==0,t);
##### 2 CommentsShowHide 1 older comment
Melika Eft on 5 Nov 2020
Thank you

Ameer Hamza on 5 Nov 2020
Edited: Ameer Hamza on 5 Nov 2020
You said without using ((solve)). Try fzero()
f = @(t) sin(2*t)-3*t-3*t+cos(t)
t_sol = fzero(f, 0)
Result
>> t_sol
t_sol =
0.2385
This solution does not require any additional toolbox.
Melika Eft on 5 Nov 2020
Thank you 🙏🏻

KSSV on 5 Nov 2020
f = @(t) sin(2*t)-6*t+cos(t) ;
t = linspace(0,1,10^6) ;
y = f(t) ;
t0 = t(abs(y)<=10^-6)
t0 = 0.2385
Melika Eft on 5 Nov 2020
Thank you