Message Boards Message Boards

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

NEED HELP recently downloaded the software

Posted 9 years ago

I recently downloaded the software but I have been having hard time with the codes if you can help me please I watched the videos and I tried exactly the same examples but something is wrong still I don't get the same answer maybe I need to fix something in the settings I'm not sure .. I need help please

POSTED BY: cristiene marcos
9 Replies

Hi Cristiene,

As others have noted, it's important to get a basic understanding of the rules of the syntax of the Wolfram Language before diving in For this I've put together some references for getting started. Take a look at this link for some of these.

http://community.wolfram.com/groups/-/m/t/613588

POSTED BY: David Reiss
Posted 9 years ago

Hi Cristiene,

First, a couple of suggestions:

If you open the Help system in Mathematica and search for "Virtual Book" you will find a very nice introduction to Mathematica. It is really worth spending some time with it.

Also, if you have trouble with a built-in function, highlight it and press F1. The Help will go right to it.

But there are a lot of helpful people here in the community as well, and they all love Mathematica. The best thing is to read How to Post. This will tell you how to post your code in a code block or attach notebooks so people who want to reply can cut and paste your code into Mathematica to try it.

Concerning your plot:

f[x_] := x Cos[1/x]

Plot[f[x], {x, 0, Pi}]

enter image description here

Notice that both Cos and Plot are capitalized. Mathematica is case sensitive, and all built-in functions are capitalized. Your symbols and functions should begin with lower case, to avoid conflict.

Best regards, David

PS: I see now some earlier responses which I duplicated. The dashboard and forum on my laptop is approximately 1 hour behind the forum as viewed on my IPad. I suspect Relativistic effects. I will try to adjust their relative velocities.

POSTED BY: David Keith

(NEED HELP recently downloaded the software)

Answer in another pod.

Here's another example of what I'm trying to do the question is f(x)=xcos(1/x) (a)define the function (b) graph it Here's what I did ( attached )

Attachments:
POSTED BY: cristiene marcos

Again, you need to learn some Syntax. As I point out in the previous response, you can use free-form input as a start.

All built-in functions in Wolfram Language start with a capital letter, so you need to enter the function as

f[x_] := x Cos[1/x]

There is no function 'graph' in Wolfram Language, which is why no plotting took place.

You could have used free form input and gotten:

enter image description here

and you would have seen that the right syntax is

Plot[x*Cos[x^(-1)], {x, -0.16, 0.16}]

This appears to be a homework exercise.

I think I have given you enough hints for the moment.

Thank you for replying back so for example the question is solve the following equation using the solve command and check your answer with a plot (a) x^2+3x+1=0

I put :

Solve[x^2 + 3 x + 1 == 0]

it gave me that :

{{x -> 1/2 (-3 - Sqrt[5])}, {x -> 1/2 (-3 + Sqrt[5])}}

when I tried to plot :

plot[function[x, x^2 + 3 x + 1][x]]

it gave me :

plot[function[x, 1 + 3 x + x^2][x]]

which is the same what I wrote so what did I do wrong ?

POSTED BY: cristiene marcos

I got an e-mail with your response, but it hasn't shown up here

This is what I got:

Thank you for replying back so for example the question is solve the following equation using the solve command and check your answer with a plot (a) x^2+3x+1=0

I put : Solve[x^2 + 3 x + 1 == 0] it gave me that : {{x -> 1/2 (-3 - Sqrt[5])}, {x -> 1/2 (-3 + Sqrt[5])}} when I tried to plot : plot[function[x, x^2 + 3 x + 1][x]] it gave me : plot[function[x, 1 + 3 x + x^2][x]] which is the same what I wrote so what did I do wrong ?

You need to learn some Wolfram Language syntax.

In[2]:= Solve[x^2 + 3 x + 1 == 0, x]

Out[2]= {{x -> 1/2 (-3 - Sqrt[5])}, {x -> 1/2 (-3 + Sqrt[5])}}

This is what Solve does. It gives you replacement rules.

If you just want answers, you can use Reduce. I did this, and applied N to give floating point numbers.

In[3]:= Reduce[x^2 + 3 x + 1 == 0, x] // N

Out[3]= x == -2.61803 || x == -0.381966

Your syntax for the plot function is not right. Look at the documentation:

Plot[x^2 + 3 x + 1, {x, -5, 5}]

will do what you want.

As a beginner, you might want to try free-form input.

At the start of a new line, type the = sign. You will get an orange box with an equals sign. Then type what you want in plain english. The input will go to the Wolfram servers, and it will interpret what it thinks you want nd give it to you.

enter image description here

Note that Mathematica will give you the correct Wolfram Language input. In this way, you can learn the system. I would recommend Cliff Hastings' (et al) new book: Hands-on Start to Wolfram Mathematica. In the book is a special code that will let you take the on-line class for free that covers part of the book.

What software? What Codes?

Hard to help with so little information.

Hi,

it will be very difficult to help you. There is no real question in your post to answer. You just state that you are having problems and that you need help. Unless you are much more specific about your problem(s) people here will have a hard time helping you.

Cheers, Marco

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

Group Abstract Group Abstract