Link to home
Create AccountLog in
Math / Science

Math / Science

--

Questions

--

Followers

Top Experts

Avatar of Mike Eghtebas
Mike Eghtebas🇺🇸

x(b) ... a(x,b) ... to give a(x)
I have following two equations (r and h are constants):

x=x(b)=r (cos(b)+ tan(b)sin(b)-1)+ tan(b)h                   (eq. 1)
 
a =a(x,b)= (1/r)*sqrt((h + rsin(b))^2 + (x + r - rcos(b))^2) - b-h/r               (eg. 2)    

to make it readable, if we assume S=Sin(b), C=Cos(b), and T=tan(b), then we get:

x=x(b)=r (C+ TS -1)+ Th      <-- these forms may be useful may be not
a =a(x,b)= (1/r)*sqrt((h + rS)^2 + (x + r - rC)^2) - b-h/r;

I want to have the following functions if possible:

a(x)=....?            (eq. 3)
b(x)=....?           (eq. 4)   <-- this one is not that important.      

Question:  Is it possible to find a(x) and b(x) having (eq. 1) and (eq. 4) above?

for background discussions please see: https://www.experts-exchange.com/questions/27237703/Animation-help-2.html

Thank you

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of TommySzalapskiTommySzalapski🇺🇸

What is b(x)? I don't see b shown as a function anywhere.
Also, if a is defined as taking two parameters then how do you drop one? How do you get from a(x,b) to just a(x)? The only way I could think of where that would make sense would be if b cancelled out of the equation, but it's not going to.

We need a lot more info before we can answer this question.

Avatar of Mike EghtebasMike Eghtebas🇺🇸

ASKER

re:> What is b(x)? I don't see b shown as a function anywhere

lets ignore b(x).  But, if we had it in a much simpler form say x=rcos(b) then

b=ArcCos(x/r)    and now we have b(x)=ArcCos(x/r)

re:> Also, if a is defined as taking two parameters then how do you drop one? How do you get from a(x,b) ...

This is why I am posting the question here hoping someone familiar with chain function possibly could come up with the answer.

thx

ASKER CERTIFIED SOLUTION
Avatar of Peter KwanPeter Kwan🇭🇰

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of TommySzalapskiTommySzalapski🇺🇸

Okay I get it. So b(x) actually is important because you replace b in the a(x,b) equation with b(x). I've never seen equations expressed as functions, but it makes sense.

I verified pkwan's math and it looks good. He used the trig identities S^2 + C^2 = 1 and S/C = T to derive eq 6 and the quadratic formula to derive eqs 7 and 8. The rest is just pretty simple algebra. Very well done.

Don't forget that when you introduce an ArcCos, you need to constrain the domain.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


When x = 0, a should be 0...
====

>> x = 10 (cos(b)+ tan(b)sin(b)-1)+ tan(b)60
   When b = 0, then x is 0 and vice-versa
http://www.wolframalpha.com/input/?i=10+%28cos%28b%29%2B+tan%28b%29sin%28b%29-1%29%2B+tan%28b%2960+for+b%3D0+to+pi%2F2

====

>> a(0,b) = (1/10)*sqrt((60 + 10sin(b))^2 + (0 + 10 - 10cos(b))^2) - b-60/10
     When b and x are 0, a is 0
http://www.wolframalpha.com/input/?i=%281%2F10%29*sqrt%28%2860+%2B+10sin%280%29%29%5E2+%2B+%280+%2B+10+-+10cos%280%29%29%5E2%29+-+0-60%2F10

====
But, ...
>> a = (1/r)*sqrt((x+r)^2+h^2-r^2) -h/r - ArcCos([r(x+r) -  h sqrt(-r^2+(x+r)^2+h^2)] / [(x+r)^2+h^2]) ... (eq. 11)

So, for equivalency, if x = 0, then a should be 0, but..

http://www.wolframalpha.com/input/?i=%281%2F10%29*sqrt%28%28x%2B10%29%5E2%2B60%5E2-10%5E2%29+-60%2F10+-+ArcCos%28%5B10%28x%2B10%29+-++60+sqrt%28-10%5E2%2B%28x%2B10%29%5E2%2B60%5E2%29%5D+%2F+%5B%28x%2B10%29%5E2%2B60%5E2%5D%29%2C+for+x+%3D+0+to+45

====

On another note, not related to this question, when looking at the graphs, it appears that the relationship between a and b is suspect, since for large x, then a small change in b should result in a large change in a. See related question: http://rdsrc.us/qNFw9P

Avatar of Mike EghtebasMike Eghtebas🇺🇸

ASKER

Hi pkwan,

Thank you for the solution. I included the functions in a java program shown below to test the equations.

At x=0, I was expecting to get zero for both a and b, but I am getting:

angle a       angel b    x
 -02.81  02.81  00.00
 -02.79  02.80  00.25
 -02.78  02.80  00.50

 -00.01  02.26  23.75
 00.03  02.25  24.00
 00.07  02.25  24.25
 00.11  02.25  24.50
 00.15  02.24  24.75
 00.19  02.24  25.00

 06.26  01.94  59.50
 06.30  01.93  59.75

Most likely this dicrepency is due to my mistkes converting from your math equation to java equations shown below:

I will go over it to locate my mistakes.
import java.text.DecimalFormat;
public class Data1 {
  public static void main(String args[]) {
      DecimalFormat df = new DecimalFormat("00.00");
      double h = 30;
      double r = 5;
      double a = 0;
      double b = 0;
      System.out.println("angle a\t angel b    x");
      for(double x = 0; x < 60; x +=0.25){
          
//b = ArcCos([r(x+r) +  h sqrt(-r^2+(x+r)^2+h^2)] / [(x+r)^2+h^2]) ................... (eq. 7)
          b = Math.acos((r*(x+r) -  h*Math.sqrt(-Math.pow(r,2)+Math.pow((x+r),2)+
                  Math.pow(h,2))) / (Math.pow((x+r),2)+Math.pow(h,2)));
          
// a = (1/r)*sqrt((x+r)^2+h^2-r^2) -h/r - ArcCos([r(x+r) -  h sqrt(-r^2+(x+r)^2+h^2)] / [(x+r)^2+h^2]) ... (eq. 11)
          a=(1/r)*Math.sqrt(Math.pow((x+r),2)+Math.pow(h,2)-Math.pow(r,2))-(h/r)-
                  Math.acos((r*(x+r)-h*Math.sqrt(-1*Math.pow(r,2)+Math.pow((x+r),2)+
                  Math.pow(h,2)))/((Math.pow((x+r),2)+Math.pow(h,2))));
          
//          System.out.println(" " + df.format(a*(180/Math.PI)) + "  " + df.format(b*(180/Math.PI)) + "  " + df.format(x));
          System.out.println(" " + df.format(a) + "  " + df.format(b) + "  " + df.format(x));
      }
  }
}

Open in new window


Avatar of Mike EghtebasMike Eghtebas🇺🇸

ASKER

Hi phoffric,

I didn't see your post.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Mike EghtebasMike Eghtebas🇺🇸

ASKER

I should have used:

x=x(b)=r (cos(b)+ tan(b)sin(b)-1)+ tan(b)h                   (eq. 1)

a = (r *tan(b) + h/cos(b) - h)/r - b                                 (eg. 2) much simpler


x = r (C+T S -1)+T/h                                                       (eq. 1a)
a = (r T + h/C - h)/r - b                                                   (eg. 2a)

now will try the solution from pkwan on these two equations,

brb

Avatar of Mike EghtebasMike Eghtebas🇺🇸

ASKER

pkwan,

I wonder if you have some time to take a look at this:

https://www.experts-exchange.com/questions/27242530/have-x-b-to-find-b-x.html

Thank you,

Mike
Math / Science

Math / Science

--

Questions

--

Followers

Top Experts

The Math / Science topic primarily includes discussions of mathematics, physics, statistics and economic analysis, but also biology, chemistry and other sciences.