Message Boards Message Boards

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

Input a big equation

Posted 9 years ago

It's silly question, but I can't input large equation, including the substitution, such as

(sh(2eta*d)(1+(alpha * F_2)^2))/(cosh(2eta*d)±sqrt(1-(sh(2eta*d)*alpha * F_2)^2))+F_1=0, F_1=2(A^2-B^2+A)/(2(A^2-B^2+A)+1), F_2=2B(2A+1)/(2(A^2-B^2+A)+1)^2, B=omega/(4*pi*gamma*M_0), A=H_0/(4*pi*M_0)

where

M_0=1760, gamma=1.465*10^-7, H_0=3300, alpha=0.002, d=0.05

In the end, I want to plot implicit function "omega(eta)" but Wolfram doesn't allow to enter so large expression. What will I do in this case? And sorry for my english...

POSTED BY: Andrey Chufyrev
9 Replies
Posted 9 years ago

You are inserting "±" into the middle of your expression and assuming WolframAlpha will understand what you mean by this.

If I try "+" it seems happy to plot a result.

With a Plus

If I try "-" it seems happy to plot a result.

With a Minus

If I try "±" it does not seem to understand what to do with this.

As politely as I can put it and I am honestly not being rude to you, if this makes you that sad then you might consider not having anything to do with software or computers in the future. Otherwise I fear you will have your heart broken on a regular basis.

WolframAlpha and even Mathematica do not have "mathematical maturity", which is defined as the ability to look at a sketch of an idea or something poorly worded or even something with several mistakes, figure out what you really meant, what you should have asked, what the answer is and explain the result to you. For people who need that then a license to Grad Student 2.0 can be had for very modest prices, but be sure to get the model that is patient, understanding, matches your style well and has relatively unlimited time to help you.

If someone handed me complicatedexpression±anothercomplicatedexpression and waited expectantly I'm not sure I would understand they wanted that plotted or even exactly what a plot of something like that might look like. And on a good day I like to think I have a tiny tiny bit of mathematical maturity, although I always wish I had much much more.

POSTED BY: Bill Simpson

Ok, now I see how Wolfram plot these two functions separately. Although Wolfram can interprete "±" sign in this expression and even can take the derivative of it, but when it comes to plotting, system surrenders. It's a little bit strange and not obviously.

Using command "ContourPlot" is also strange, because my function is just a simple 2D graphic (just in implicity form). However this method is used in similar cases in other mathematical instruments too.

I don't want to say that Wolfram is bad or something. When I started using it, Wolfram attracted me by its simplicity and understanding at a glance, particular intuition. So when I needed a tool for real complicated and big mathematical objectives, I immediately remembered about Wolfram, waiting for qualitative results and enjoyable work, and bought Pro.

My friend plot this function in GnuPlot and it was simple. We specify constants and write the expression to plot. At the same time I was trying to solve this problem by Wolfram... It's not an advertising, just a fact.

I'm not rude on you too, all this is just my thoughts.

POSTED BY: Andrey Chufyrev
Posted 9 years ago

In my experience, many things are not obvious about WolframAlpha. When it first appeared I would keep trying variations of a question and sometimes never did figure out how to get it to understand and give me an answer, whether asking it to plot statistical data or complicated mathematical results.

I chose ContourPlot exactly because your expression was in implicit form.

For very simple problems it can be simple to use. For more complicated problems it becomes more difficult, sometimes much more difficult and perhaps even impossible to use.

If someone is experienced in using x then often using x for a problem is easier. If someone is not experienced in using x then often using x for a problem is much more difficult.

I did not consider you to be rude to me. I only suggested that WolframAlpha or software may not be the best for you.

POSTED BY: Bill Simpson
Posted 9 years ago

One option is to pay for a subscription to WolframAlpha Pro which allows you to upload much larger expressions.

Another option is to make use of substitutions to shorten your expression.

Since you use 2(A^2-B^2+A) in several places you can start with n=2(A2-B2+A), followed by the rest of your expression where you replace all 2(A^2-B^2+A) with n.

Then you can shorten all your multiple character variable names down to single character names, but avoid using variable names that WolframAlpha will assume have predefined mathematical meaning.

With that it appears to be possible to get your expression down within the string length limitation of WolframAlpha.

d=.05,k=.002,h=3300,m=1760,g=1.465*10^-7,n=2(A2-B2+A),l=n/(n+1),p=2B(2A+1)/(n+1)^2,B=o/(4 pi g m),A=h/(4 pi m),(s(2j d)(1+(k p)^2))/(cosh(2j d)±sqrt(1-(s(2j d)k p)^2))+l=0

Unfortunately, even though it appears that it might be short enough now, WolframAlpha cannot understand what you now want it to do with this long expression.

Sometimes it is possible to do a problem in two steps when using WolframAlpha. To do that you try to find a way to get a partial answer to your problem in one step, copy and paste that answer to form part of the rest of your final question. Can you see any way to divide your question into two parts that might be smaller?

Even with that I don't know what you are expecting the values of sh or eta to be.

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