Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hi,
I have this equation:
I want to find time t (a symbolic expression for t) at which the above function is equal with 1. So:
What I am missing?
Solved! Go to Solution.
I don't see any problem here and don't understand why you think that t=0.1 should be a solution - it isn't.
I don't see any problem here and don't understand why you think that t=0.1 should be a solution - it isn't.
Ok, I see, ok, thanks.
Now going also to an numerical approach solution for this problem. How to find t2 value above obtained by symbolic means way that gives f(t2(), , )=1?
For example one method at which I am thinking by now (but also other approaches are welcome): to iterate time t and then to look/check where f() have the desire value, in this case 1.
How to implement below things?
For this we need to check in the f() where f() = 1:
Then:
And finally to find the corresponding index found at Step 2 in the t column vector.
But as I said, other methods to achieve this thing (of finding time t at which f() is equal with 1) are welcome if exists. This above method is only at which I am thinking by now.
Have you tried the root() function?
Success!
Luc
Hm, now yeah, but I will still like to see an implementation based on the searching/steps that I wrote above. Here we need to have high precision on y axis.
On the other hand it seems that we can find multiple roots?
On the other hand it seems that we can find multiple roots?
Yes, your equation has an infinite number of solutions, but not the values you show using the root function.
If you look at the exact symbolic solutions of your equation, you see that it contains an arctan function. You always can add any integer multiples of pi there and get another solution for your equation.
But because the function values are so close to 1 for t>0,36, you can't find these other values with Primes numerical methods - you need the exact symbolic expression for t.
See my other, edited answer for some pics and the worksheet.
Why would you program your own iteration when Prime provides means to do it faster and with higher precision?
To solve an equation numerically you always can either use the "root" function in one of its two flavours or a solve block with "Find".
Concerning approach 1) you have to take care to set the end value not too high (2.5 is a good choice) because for larger values the function value will always be equal to 1 within the available tolerance. [EDIT: Thats the reason why you got 'multiple" roots - any number higher than 3.6 will look like be root] You can see why if you zoom in:
So any value of t grater than 2.36 will yield a function value of "exactly" 1 within Primes numeric precision. Thats because it uses like most other software the IEEE format to store numeric values. The symbolic engine has its own way to store numbers with much higher precision.
So you see that because of the periodicity of tan we get an infinite number of results for atan (we can add/subtract any integer multiple of pi) and therefore an infinite number of solutions for your equation.
But anyway how a program will look like to implement these 2 steps? Only for curiosity
Something like that:
1) Use a vector t, not a range as otherwise f(t...) is an invalid object you can't use
2) Lookup the "match" function or, even better, the "lookup" function, in the help.
The "match" function will do what you describe as Step 2, but with the "lookup" function you can do Step 2 and Step 3 in one go.
You have to set TOL to a very small value as otherwise you will get too many "solutions".
Good luck!