Message Boards Message Boards

0
|
11402 Views
|
9 Replies
|
1 Total Likes
View groups...
Share
Share this post:
GROUPS:

Input a big equation

Posted 9 years ago
POSTED BY: Andrey Chufyrev
9 Replies
Posted 9 years ago
POSTED BY: Bill Simpson
POSTED BY: Andrey Chufyrev
Posted 9 years ago
POSTED BY: Bill Simpson
Posted 9 years ago
POSTED BY: Bill Simpson

Thank you, I'll try this method of separate calculation, but I'm not sure this will work well... I have PRO subscription already, but I didn't understand how upload this expression. Data-upload provides upload tabular data etc. and File-upload allow only specific file types. "Sh" mean "sinh" (Wolfram|Alpha understand it) and "eta" is Greek letter.

POSTED BY: Andrey Chufyrev
Posted 9 years ago

Using WolframAlpha one step at a time to do the substitutions and simplifications I end up with

Contour Plot

I've replaced omega with y and 2 eta d with x because I've sometimes seen WolframAlpha better understand a question framed in terms of x and y. Check all that carefully to make certain I haven't made a mistake. All that barely fits within the string length limitations for input. You can also use Plot3D in place of ContourPlot. WolframAlpha also recognizes 1.80016* ^-6 to be 1.80016* 10^-6 and that can let you squeeze in twelve more characters if you need that. Note: For WolframAlpha input eliminate the spaces following the * in the line above this, which I had to introduce to keep the forum software from thinking that in this message what I meant to do was to italicize the text following those instead of just displaying the * . Note: You can also use y2 with WolframAlpha to denote the square of y, and that can save you a handful more characters, but this does not work with (x+y)2 or with Cosh(x)2. You also have three identical expressions in your denominators. If in WolframAlpha you could assign that value to say q and then replace those expressions with q that would free up even more space. I had that working at one point, then it failed and I gave up trying to chase down what the problem was with that.

POSTED BY: Bill Simpson

I got the following expression.

Expression

But Wolfram doesn't want to plot this... It's so sad, I thought Wolfram|Alpha is more powerful than turned out.

POSTED BY: Andrey Chufyrev

breaking it down into steps, something like this:

In[22]:= eq = (sh (2 eta*
        d) (1 + (alpha*F2)^2))/(cosh (2 eta*d) \[PlusMinus] 
      sqrt (1 - (sh (2 eta*d)*alpha*F2)^2)) + F1 == 0

Out[22]= F1 + (2 d eta (1 + alpha^2 F2^2) sh)/(
  2 cosh d eta \[PlusMinus] (1 - 
      4 alpha^2 d^2 eta^2 F2^2 sh^2) sqrt) == 0

In[23]:= eq1 = eq /. F1 -> 2 (A^2 - B^2 + A)/(2 (A^2 - B^2 + A) + 1)

Out[23]= (2 (A + A^2 - B^2))/(1 + 2 (A + A^2 - B^2)) + (
  2 d eta (1 + alpha^2 F2^2) sh)/(
  2 cosh d eta \[PlusMinus] (1 - 
      4 alpha^2 d^2 eta^2 F2^2 sh^2) sqrt) == 0

In[24]:= eq2 = eq1 /. F2 -> 2 B (2 A + 1)/(2 (A^2 - B^2 + A) + 1)^2

Out[24]= (2 (A + A^2 - B^2))/(1 + 2 (A + A^2 - B^2)) + (
  2 (1 + (4 (1 + 2 A)^2 alpha^2 B^2)/(1 + 
       2 (A + A^2 - B^2))^4) d eta sh)/(
  2 cosh d eta \[PlusMinus] (1 - (
      16 (1 + 2 A)^2 alpha^2 B^2 d^2 eta^2 sh^2)/(1 + 
        2 (A + A^2 - B^2))^4) sqrt) == 0

In[25]:= eq3 = eq2 /. B -> omega/(4*Pi*gamma*M0) /. A -> H0/(4*Pi*M0)

Out[25]= (
  2 (H0^2/(16 M0^2 \[Pi]^2) - omega^2/(16 gamma^2 M0^2 \[Pi]^2) + H0/(
     4 M0 \[Pi])))/(
  1 + 2 (H0^2/(16 M0^2 \[Pi]^2) - omega^2/(16 gamma^2 M0^2 \[Pi]^2) + 
      H0/(4 M0 \[Pi]))) + (
  2 d eta (1 + (alpha^2 omega^2 (1 + H0/(2 M0 \[Pi]))^2)/(
     4 gamma^2 M0^2 (1 + 
        2 (H0^2/(16 M0^2 \[Pi]^2) - omega^2/(
           16 gamma^2 M0^2 \[Pi]^2) + H0/(
           4 M0 \[Pi])))^4 \[Pi]^2)) sh)/(
  2 cosh d eta \[PlusMinus] (1 - (
      alpha^2 d^2 eta^2 omega^2 (1 + H0/(2 M0 \[Pi]))^2 sh^2)/(
      gamma^2 M0^2 (1 + 
         2 (H0^2/(16 M0^2 \[Pi]^2) - omega^2/(
            16 gamma^2 M0^2 \[Pi]^2) + H0/(
            4 M0 \[Pi])))^4 \[Pi]^2)) sqrt) == 0

In[26]:= eqf = 
 eq3 /. {M0 -> 1760, gamma -> 1.465*10^-7, H0 -> 3300, alpha -> 0.002,
    d -> 0.05}

Out[26]= (2 (-95253.2 omega^2 + 225/(1024 \[Pi]^2) + 15/(32 \[Pi])))/(
  1 + 2 (-95253.2 omega^2 + 225/(1024 \[Pi]^2) + 15/(32 \[Pi]))) + (
  0.1 eta (1 + (
     2.56937 omega^2)/(1 + 
       2 (-95253.2 omega^2 + 225/(1024 \[Pi]^2) + 15/(
          32 \[Pi])))^4) sh)/(
  0.1 cosh eta \[PlusMinus] (1 - (
      0.0256937 eta^2 omega^2 sh^2)/(1 + 
        2 (-95253.2 omega^2 + 225/(1024 \[Pi]^2) + 15/(
           32 \[Pi])))^4) sqrt) == 0

remember = is an assignment, == is an equation and -> is a rule, capital letters for build in functions and constants: Pi and don't use underscore in variable names as it also has a special meaning.

POSTED BY: Kay Herbert

Thank you for answer, but your code is for Wolfram, not Wolfram|Alpha, isn't it?

POSTED BY: Andrey Chufyrev
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract