cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Problem with finding a time symbolic expression at which function become unity

Cornel
19-Tanzanite

Problem with finding a time symbolic expression at which function become unity

Hi,

I have this equation:

Cornel_0-1724330931382.png

I want to find time t (a symbolic expression for t) at which the above function is equal with 1. So:

Cornel_1-1724331038513.png

 

Cornel_0-1724331607352.png

What I am missing?

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Cornel)

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.

Werner_E_0-1724356720069.png

 

View solution in original post

8 REPLIES 8
Werner_E
25-Diamond I
(To:Cornel)

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.

Werner_E_0-1724356720069.png

 

Cornel
19-Tanzanite
(To:Werner_E)

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?

Cornel_2-1724397043969.png

 

Cornel_0-1724397028830.png

Cornel_1-1724397035491.png

For this we need to check in the f() where f() = 1:

Cornel_3-1724397118341.png

 

Then:

Cornel_4-1724397192413.png

 

And finally to find the corresponding index found at Step 2 in the t column vector.

 

Cornel_7-1724397437116.png

 

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.

 

LucMeekes
23-Emerald III
(To:Cornel)

Have you tried the root() function?

 

Success!

Luc

Cornel
19-Tanzanite
(To:LucMeekes)

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.

Cornel_1-1724400796147.png

 

Cornel_0-1724400740445.png

 

On the other hand it seems that we can find multiple roots?

Cornel_2-1724400999375.png

 

 

 

Werner_E
25-Diamond I
(To:Cornel)


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.

Werner_E
25-Diamond I
(To:Cornel)

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".

Werner_E_0-1724404217007.png

 

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:

Werner_E_1-1724403369314.png

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.

Werner_E_2-1724405284640.png

 

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.

 

 

Cornel
19-Tanzanite
(To:Werner_E)

But anyway how a program will look like to implement these 2 steps? Only for curiosity

Cornel_0-1724412378360.png

 

Cornel_1-1724412402474.png

Something like that:

Cornel_2-1724412572832.png

Werner_E
25-Diamond I
(To:Cornel)

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".

Werner_E_1-1724416156928.png

 

Good luck!

 

Announcements

Top Tags