Group Abstract Group Abstract

Message Boards Message Boards

0
|
12.2K Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Get the Mathematica code used to process a Wolfram Alpha query?

Posted 9 years ago

Hello

Let's take a simple example:

WolframAlpha["get arclength of sin of x from 0 to 3Pi/2"]

I get back in a pod the symbolic result with its numeric value (5.73) and in another pod a nice graphic.

Without the help of WolframAlpha

ArcLength[{Sin[\[Theta]]}, {\[Theta], 0, 3 Pi/2 }] 

which returns 3 and I'm fairly sure this answer is correct

So the first pod has a different answer and I would like to know which Mathematica input code did WolframAlpha use in order to understand what is going on (and also how the symbolic integral was constituted in the output).

The graphics in the second pod would take me a long time to achieve with Mathematica only. Wouldn't it be very pedagogic if the code built to produce it could be accessed ?

Thanks

POSTED BY: Jan Potocki
5 Replies

But how can you ask WolframAlpha to return the code that created the whole graphics?

I don't think that is possible.

Cheers,

M.

POSTED BY: Marco Thiel

Hi,

You left unanswered the second part of my question about the pod with the graphics. I'm not asking what the code is to generate it (I can do that, albeit not at the click of the fingers) but how do you get it from any WolframAlpha query (if that functionality is available, it would be very nice)

Like this?

WolframAlpha["get arclength of sin of x from 0 to 3Pi/2", {{"Plot", 1}, "Content"}]

My question was more general than for this example with the length of an arc (and my MMA code was for something else). I don't know how general your answer is as I notice that WolframAlpha does not use the ArcLength function which is rather new (and I suspect most new functions can be obtained using functions available in older MMA versions)

I am not sure I understand. I think that the answer is quite general in the sense that it gives you what Wolfram|Alpha uses. The first solution (using ArcLength) was just what I intuitively used because it is less typing than the automatic solution that Wolfram|Alpha creates.

Cheers,

M.

POSTED BY: Marco Thiel
Posted 9 years ago

Thanks Marco

We are nearly there:

 WolframAlpha["get arclength of sin of x from 0 to 3Pi/2", {{"Plot", 1}, "Content"}]

gets just the graphics and not the code that created it.

By toying a little, I saw that with

 WolframAlpha["get arclength of sin of x from 0 to 3Pi/2", {{"Plot",    1}, "Input"}]

I get at least the first part of what I'm looking for. But how can you ask WolframAlpha to return the code that created the whole graphics?

Regards

POSTED BY: Jan Potocki
Posted 9 years ago

Thanks Marco

My question was more general than for this example with the length of an arc (and my MMA code was for something else).

I don't know how general your answer is as I notice that WolframAlpha does not use the ArcLength function which is rather new (and I suspect most new functions can be obtained using functions available in older MMA versions)

You left unanswered the second part of my question about the pod with the graphics. I'm not asking what the code is to generate it (I can do that, albeit not at the click of the fingers) but how do you get it from any WolframAlpha query (if that functionality is available, it would be very nice)

Regards

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