Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- 2 Trigonometric function with two unidentified

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-08-2019
06:33 PM

03-08-2019
06:33 PM

Hello guys, I am stuck for two days about an issue. I have to create a solution matrix for the following two trigonometric functions.

m*cos(a)+n*cos(b)=x

m*sin(a)+n*sin(b)=y

0<a<180 , 0<b<180

m,n,x,y are constants. a,b are unidentified.

How can I solve x,y as matrix solution?

I will trigger x,y values with FRAME, so at each X.i, Y.i values I have to calculate a,b degrees and draw lines.

I am using MathCAD 15.

I would really appreciate your help. Thanks in Advance!

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
02:54 PM

03-09-2019
02:54 PM

If you limit Theta2, too (positive in the range from 0 to 180°) you have a unique, single solution.

One way to calculate the angles Theta1 and Theta2 based on the coordinates x,y of the endpoint is shown in the picture below:

22 REPLIES 22

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
01:03 AM

03-09-2019
01:03 AM

Re: 2 Trigonometric function with two unidentified

You would like to create an animation if you use the FRAME variable?

Let us create one frame of this animation!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
02:34 AM

03-09-2019
02:34 AM

Re: 2 Trigonometric function with two unidentified

Thank you for your intention @ValeryOchkov

I'll show with sketch in add.

There is K.i matrix. It consists nodes that arm going to reach. Arms are should be rectangular boxes. I wrote the translational and rotational matrix. Arms are working perfrectly fine. But it needs target node in order to calculate teta1 and alpha angles.

For example K.1 is (x,y)=(450,600)

It will calculate these angles then will go to K.2=(460,590), later on K.3=(465,582) and so on.

I will later make K.i matrix with bezier if I can finish this earlier. It has manual nodes added by me now.

I hope I could explained myself clearly. Thank you!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
03:30 AM

03-09-2019
03:30 AM

Re: 2 Trigonometric function with two unidentified

May be so

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
08:31 AM

03-09-2019
08:31 AM

Re: 2 Trigonometric function with two unidentified

see please the attach

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
01:17 PM

03-09-2019
01:17 PM

Re: 2 Trigonometric function with two unidentified

Thank you really much. I am now trying to understand it. You're the best

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
05:23 AM

03-09-2019
05:23 AM

Re: 2 Trigonometric function with two unidentified

Hi,

The analytical solution gives me these results:

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
05:59 AM

03-09-2019
05:59 AM

Re: 2 Trigonometric function with two unidentified

When a function with sin and cos, it's easier to make matrix solution. However in my function, there are only cos or sin one function :(. I have to make a general matrix solution. I am sorry I couldn't understand by your point. What do you suggest me to do exactly. I need this kind of solution below:

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
08:07 AM

03-09-2019
08:07 AM

Re: 2 Trigonometric function with two unidentified

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
08:16 AM

03-09-2019
08:16 AM

Re: 2 Trigonometric function with two unidentified

Thank you really but I gave it as an example. The actual functions I ask are in The main post. I know this one...

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
10:49 AM

03-09-2019
10:49 AM

Re: 2 Trigonometric function with two unidentified

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
01:18 PM

03-09-2019
01:18 PM

Re: 2 Trigonometric function with two unidentified

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
11:31 AM

03-09-2019
11:31 AM

Re: 2 Trigonometric function with two unidentified

Your problem normally has two solutions (can be clearly seen in Valerys animation).

So how can you expect a single, linear matrix solution?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
12:50 PM

03-09-2019
12:50 PM

Re: 2 Trigonometric function with two unidentified

Thanks Werner! This system of two equations has two solutions - x1-y1 and x2-y2:

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
01:19 PM

03-09-2019
01:19 PM

Re: 2 Trigonometric function with two unidentified

I expected to limit them between 0<teta<180 in order to have one solution.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
01:45 PM

03-09-2019
01:45 PM

Re: 2 Trigonometric function with two unidentified

In your original question you limited a and b in the range from 0 to 180 degrees and this would not have guaranteed a single unique solution.

Obviously now you are referring to the drawing you posted later. Theta2 has a different meaning (compared to b). Limiting Theta2 can make the solution unique. Nonetheless its still not a linear problem and so you can't solve it with matrix operations.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
02:20 PM

03-09-2019
02:20 PM

Re: 2 Trigonometric function with two unidentified

You are right. I'm still ignorant about it. Solutions above are fulfill task. However my point is defining two angle so trigger the system based on those angle. But you're saying it isn't possible due to fact that there will not be unique solution. Isn't there any way to eliminate the solution we don't want?

Let me give you the way in my mind:

if I draw the closed loop in the first zone(+x,+y) and let theta1 won't go below 0 (will be limited 0<theta1<180)

we still cannot avoid to calculate other solution?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
02:50 PM

03-09-2019
02:50 PM

Re: 2 Trigonometric function with two unidentified

May be so

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
02:54 PM

03-09-2019
02:54 PM

If you limit Theta2, too (positive in the range from 0 to 180°) you have a unique, single solution.

One way to calculate the angles Theta1 and Theta2 based on the coordinates x,y of the endpoint is shown in the picture below:

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
04:35 PM

03-09-2019
04:35 PM

Re: 2 Trigonometric function with two unidentified

And here's a small animation using the above formulas

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
05:18 PM

03-09-2019
05:18 PM

Re: 2 Trigonometric function with two unidentified

I really appreciate this and I feel dumber each time asking you after your precious messages 🙂

a small question: I want to start as Teta1=0 then

the values from your codes

I need to do exception for i=0

it will be like;

i=0 --> Theta1=0

i=1..20 Matrix calculated Theta values

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
05:44 PM

03-09-2019
05:44 PM

Re: 2 Trigonometric function with two unidentified

You mean Theta1 = Theta2 = 0? Some sort of rest position?

There is no exception. You simply add the point with the coordinates (L.A+L.B / 0) as first point of your Matrix of K points. You have to decide which way the robot arms should chose to move from rest position to the first point of your curve and at which speed.

You wrote in a previous answer that you have a bunch of points K and intend to connect them via a Bezier curve.

So you may simply ad the start point in front - maybe even a few more points between the start point and the first regular "K-point". This insertion of points could be done by linear interpolation.

After the adding the point(s) go ahead with your Bezier.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-09-2019
05:51 PM

03-09-2019
05:51 PM

Re: 2 Trigonometric function with two unidentified

I found a sneaky way to make it.

Thank you for everything. I will try to move them with rectangular boxes.