![RobotStudio event](https://new.abb.com/images/librariesprovider89/default-album/robotstudio-webinar-arc-welding.jpg)
Natural Log function ln(x)
![BigM](https://secure.gravatar.com/avatar/5a0b08168bfe7a807bfd3b3ab349429f/?default=https%3A%2F%2Fus.v-cdn.net%2F5020483%2Fuploads%2Fdefaultavatar%2FK2266OAKOLNC.jpg&rating=g&size=200)
BigM
✭
Hi,
Has anyone been able to generate a function for the natual logarithm (ie: log base 'e') ???
I've looked through the RAPID reference maula and the only function that closely relates is the exponential function.
Is there a way to generate it?
If not, an approximation?
Regards,
bigM
0
Comments
-
Well, after some investigation I have generated this so far.The natural log can be approximated by the equation
Letting
and thus
, we get
In order to get the accuracy i require I've gone to the 1999th degree.Here it is...FUNC num Ln (num z)
VAR num x;
VAR num answer;
!
answer:=0;
x:=((z-1)/(z+1));
!
FOR i from 1 TO 1999 STEP 2 DO
answer:= answer + (2*(POW(x,i)/i));
ENDFOR
!
RETURN (answer);
ENDFUNCThis approximation should be sufficient, are there any other suggestions?Regards,bigM0
Categories
- All Categories
- 5.5K RobotStudio
- 397 UpFeed
- 18 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 319 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 804 RAPID Programming
- 4 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings