I am not getting exact value when I substitute the integer in a trignometric function

syms L
F=0.65-0.75/(1+L^2)-0.65*atan(1/L);
L=0.1;
subs(F);
i am getting answer as
ans =
- (13*atan(10))/20 - 187/2020
where i am expecting answer as -0.18819

1 Comment

I'm not sure what's going on here. Since 0.1 isn't an integer, what integer are you referring to? That expression is the exact value. Something like -0.18819 is a floating point approximation. That said, I don't know where you're getting that number. Is it because you're substituting something other than 0.1?
syms L
F = 0.65-0.75./(1+L.^2)-0.65*atan(1./L);
r = subs(F,L,0.1)
r = 
double(r)
ans = -1.0488
Lq = vpasolve(F == -0.18819,L)
Lq = 
1.0700201776695503481435939309154

Sign in to comment.

Answers (0)

Products

Release

R2020a

Edited:

DGM
on 9 Nov 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!