Hallo,
I am currently working on an app for calculating zeropoints for my students using numerical methods.
I started with the Bisection Method Algorithm.
It currently works with a procedure with a fixed mathematical function f(x)=x*x-2
I would like to enter the function in a text box (example: x*x-2) and then the content of the text box should be converted into a function.
Are there any ideas for this?
And here the aia file:
NumVerfahren.aia (28.7 KB)
To test:
a=0
b=6
Epsilon=0.0001
Greeting Frank
TIMAI2
2
Sounds like you want this:
Thank you TimAI2 for your tip.
Property the extension merged. Unfortunately I don't know how to enter the function as a string.
How do I have to format the string so that f(x)=x*x-2 is calculated with x=3?
The result f(3) must then be 7.
Frank
TIMAI2
4
Use a result procedure
![image](https://community.appinventor.mit.edu/uploads/default/original/3X/e/2/e2fff460a961415681599428d8ab142f0a928ab2.png)
Of course, you can just use the built-in maths blocks for this:
![image](https://community.appinventor.mit.edu/uploads/default/original/3X/5/8/58f3e6f983199fa499cad1f0fb4cce160d472552.png)
Thanks, that's not my problem.
I want to use a string from a text box as a function for calculation.
The user enters the function in the text box and the app can calculate with this function.
Frank
TIMAI2
6
OK, there will need to be some text manipulation for that. Give a me a couple of minutes.
Thank you so much TimAI2.
This works perfectly now.
Here is the current aia file:
NumVerfahren.aia (524.4 KB)
My thanks also go to Taifun for providing the extension.
Frank
1 Like
Another way with no extension:
![Snipaste_2022-05-19_21-16-08](https://community.appinventor.mit.edu/uploads/default/original/3X/a/9/a9dad4a5b79d07f9034480578e216e7f6bc6d360.png)
4 Likes