General::ivar 0 is not a valid variable when using Series in PlotGeneral::ivar is not a valid variable when plotting - what actually causes this and how to avoid it?Series and that old ivar errorGeneral::ivar is not a valid variable when plotting - what actually causes this and how to avoid it?Problems with For statementAdding plot legends in version 8Series and that old ivar errorHow to define a function that is related to derivative of Jacobi theta functionQuartic function from dataImplementing an integral test for series convergenceGeneral: 0 is not a valid variableWhy is ww[[1]] not a valid variable in FindMinValue and PlotEvaluation of an Error function
Why isn’t SHA-3 in wider use?
When does Tiana, Ship's Caretaker check card type?
Generate Brainfuck for the numbers 1–255
How would timezones work on a planet 100 times the size of our Earth
Is it feasible to get a hash collision for CRC32, MD-5 and SHA-1 on one file?
If "more guns less crime", how do gun advocates explain that the EU has less crime than the US?
Can "être sur" mean "to be about" ?
What ability do tools use?
Is there a command to install basic applications on Ubuntu 16.04?
Is this curved text blend possible in Illustrator?
The cat ate your input again!
Breadcrumb history decision
Submitting a new paper just after another was accepted by the same journal
Understanding this peak detector circuit
What should I call bands of armed men in the Middle Ages?
What is this 1990s horror game of otherworldly PCs dealing with monsters on modern Earth?
Simplification of numbers
A continuous water "planet" ring around a star
How can this older-style irrigation tee be replaced?
What is the status of the F-1B engine development?
What is a good class if we remove subclasses?
How to disable "Completion time:..." in SQL Server Messages window
Loading military units into ships optimally, using backtracking
Can the ground attached to neutral fool a receptacle tester?
General::ivar 0 is not a valid variable when using Series in Plot
General::ivar is not a valid variable when plotting - what actually causes this and how to avoid it?Series and that old ivar errorGeneral::ivar is not a valid variable when plotting - what actually causes this and how to avoid it?Problems with For statementAdding plot legends in version 8Series and that old ivar errorHow to define a function that is related to derivative of Jacobi theta functionQuartic function from dataImplementing an integral test for series convergenceGeneral: 0 is not a valid variableWhy is ww[[1]] not a valid variable in FindMinValue and PlotEvaluation of an Error function
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I have been having some trouble graphing a Taylor series approximation (Series
).
f[x] := Series[E^(-x/4) Sin[3 * x], x, 1, 4]
Plot[f[x], x, 0, 6]
General::ivar: 0.00012257142857142857` is not a valid variable.
How can I fix this error?
plotting error variable
$endgroup$
|
show 1 more comment
$begingroup$
I have been having some trouble graphing a Taylor series approximation (Series
).
f[x] := Series[E^(-x/4) Sin[3 * x], x, 1, 4]
Plot[f[x], x, 0, 6]
General::ivar: 0.00012257142857142857` is not a valid variable.
How can I fix this error?
plotting error variable
$endgroup$
5
$begingroup$
Usef[x_] := ...
notf[x] := ...
. Please see Defining functions.
$endgroup$
– Szabolcs
Aug 1 at 5:39
1
$begingroup$
@Szabolcs and others, I reopened the question because that comment is not an answer. As shown in the last code block in my answer it does not even need to be a part of the answer. I believe voters were influenced by your comment but I won't reopen it again if it gets closed again.
$endgroup$
– Kuba♦
Aug 1 at 9:14
$begingroup$
Please include the message name to make it easier for others who have the same problem to search for and find this question
$endgroup$
– Michael E2
Aug 1 at 11:47
$begingroup$
@Kuba Duplicate?: mathematica.stackexchange.com/q/48980/4999
$endgroup$
– Michael E2
Aug 1 at 11:49
$begingroup$
Related: mathematica.stackexchange.com/q/1301/4999
$endgroup$
– Michael E2
Aug 1 at 11:53
|
show 1 more comment
$begingroup$
I have been having some trouble graphing a Taylor series approximation (Series
).
f[x] := Series[E^(-x/4) Sin[3 * x], x, 1, 4]
Plot[f[x], x, 0, 6]
General::ivar: 0.00012257142857142857` is not a valid variable.
How can I fix this error?
plotting error variable
$endgroup$
I have been having some trouble graphing a Taylor series approximation (Series
).
f[x] := Series[E^(-x/4) Sin[3 * x], x, 1, 4]
Plot[f[x], x, 0, 6]
General::ivar: 0.00012257142857142857` is not a valid variable.
How can I fix this error?
plotting error variable
plotting error variable
edited Aug 2 at 9:38
rhermans
23.8k4 gold badges42 silver badges110 bronze badges
23.8k4 gold badges42 silver badges110 bronze badges
asked Aug 1 at 5:29
Oliver MurfettOliver Murfett
161 bronze badge
161 bronze badge
5
$begingroup$
Usef[x_] := ...
notf[x] := ...
. Please see Defining functions.
$endgroup$
– Szabolcs
Aug 1 at 5:39
1
$begingroup$
@Szabolcs and others, I reopened the question because that comment is not an answer. As shown in the last code block in my answer it does not even need to be a part of the answer. I believe voters were influenced by your comment but I won't reopen it again if it gets closed again.
$endgroup$
– Kuba♦
Aug 1 at 9:14
$begingroup$
Please include the message name to make it easier for others who have the same problem to search for and find this question
$endgroup$
– Michael E2
Aug 1 at 11:47
$begingroup$
@Kuba Duplicate?: mathematica.stackexchange.com/q/48980/4999
$endgroup$
– Michael E2
Aug 1 at 11:49
$begingroup$
Related: mathematica.stackexchange.com/q/1301/4999
$endgroup$
– Michael E2
Aug 1 at 11:53
|
show 1 more comment
5
$begingroup$
Usef[x_] := ...
notf[x] := ...
. Please see Defining functions.
$endgroup$
– Szabolcs
Aug 1 at 5:39
1
$begingroup$
@Szabolcs and others, I reopened the question because that comment is not an answer. As shown in the last code block in my answer it does not even need to be a part of the answer. I believe voters were influenced by your comment but I won't reopen it again if it gets closed again.
$endgroup$
– Kuba♦
Aug 1 at 9:14
$begingroup$
Please include the message name to make it easier for others who have the same problem to search for and find this question
$endgroup$
– Michael E2
Aug 1 at 11:47
$begingroup$
@Kuba Duplicate?: mathematica.stackexchange.com/q/48980/4999
$endgroup$
– Michael E2
Aug 1 at 11:49
$begingroup$
Related: mathematica.stackexchange.com/q/1301/4999
$endgroup$
– Michael E2
Aug 1 at 11:53
5
5
$begingroup$
Use
f[x_] := ...
not f[x] := ...
. Please see Defining functions.$endgroup$
– Szabolcs
Aug 1 at 5:39
$begingroup$
Use
f[x_] := ...
not f[x] := ...
. Please see Defining functions.$endgroup$
– Szabolcs
Aug 1 at 5:39
1
1
$begingroup$
@Szabolcs and others, I reopened the question because that comment is not an answer. As shown in the last code block in my answer it does not even need to be a part of the answer. I believe voters were influenced by your comment but I won't reopen it again if it gets closed again.
$endgroup$
– Kuba♦
Aug 1 at 9:14
$begingroup$
@Szabolcs and others, I reopened the question because that comment is not an answer. As shown in the last code block in my answer it does not even need to be a part of the answer. I believe voters were influenced by your comment but I won't reopen it again if it gets closed again.
$endgroup$
– Kuba♦
Aug 1 at 9:14
$begingroup$
Please include the message name to make it easier for others who have the same problem to search for and find this question
$endgroup$
– Michael E2
Aug 1 at 11:47
$begingroup$
Please include the message name to make it easier for others who have the same problem to search for and find this question
$endgroup$
– Michael E2
Aug 1 at 11:47
$begingroup$
@Kuba Duplicate?: mathematica.stackexchange.com/q/48980/4999
$endgroup$
– Michael E2
Aug 1 at 11:49
$begingroup$
@Kuba Duplicate?: mathematica.stackexchange.com/q/48980/4999
$endgroup$
– Michael E2
Aug 1 at 11:49
$begingroup$
Related: mathematica.stackexchange.com/q/1301/4999
$endgroup$
– Michael E2
Aug 1 at 11:53
$begingroup$
Related: mathematica.stackexchange.com/q/1301/4999
$endgroup$
– Michael E2
Aug 1 at 11:53
|
show 1 more comment
1 Answer
1
active
oldest
votes
$begingroup$
There are couple of problems with your code.
- It is an image, it would be way nicer not to have to rewrite it.
Plotting
Series
If you go to ref / Series / Application you will see that
Normal
is used to plot aSeries
as otherwiseO[x]^n
will makePlot
confused.Function definition
Functions are defined more or less like that
f[x_]:=...
but ifx
is an argument to your function thenSeries
specx,1,4
will become invalid asx
will be replace with the passed value.You need to create series before you pass the value. One way to do this is to create series once for all by doing it during definition:
=
vs:=
:
So a 'proper way' to get what you need is:
ClearAll[f];
f[x_] = Normal @ Series[E^(-x/4) Sin[3 x], x, 1, 4]
Plot[f[x], x, 0, 6]
Coincidentally you original code was close to working, if you know what is going on:
ClearAll[f];
f[x] := Series[E^(-x/4) Sin[3 x], x, 1, 4]
Plot[Evaluate@Normal@f[x], x, 0, 6]
But this is not a way to go anyway.
$endgroup$
1
$begingroup$
ClearAll[f,x]
? If you are ensuring there are no lingering definitions, then probably address all the symbols involved?
$endgroup$
– rhermans
Aug 2 at 9:23
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f203084%2fgeneralivar-0-is-not-a-valid-variable-when-using-series-in-plot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
There are couple of problems with your code.
- It is an image, it would be way nicer not to have to rewrite it.
Plotting
Series
If you go to ref / Series / Application you will see that
Normal
is used to plot aSeries
as otherwiseO[x]^n
will makePlot
confused.Function definition
Functions are defined more or less like that
f[x_]:=...
but ifx
is an argument to your function thenSeries
specx,1,4
will become invalid asx
will be replace with the passed value.You need to create series before you pass the value. One way to do this is to create series once for all by doing it during definition:
=
vs:=
:
So a 'proper way' to get what you need is:
ClearAll[f];
f[x_] = Normal @ Series[E^(-x/4) Sin[3 x], x, 1, 4]
Plot[f[x], x, 0, 6]
Coincidentally you original code was close to working, if you know what is going on:
ClearAll[f];
f[x] := Series[E^(-x/4) Sin[3 x], x, 1, 4]
Plot[Evaluate@Normal@f[x], x, 0, 6]
But this is not a way to go anyway.
$endgroup$
1
$begingroup$
ClearAll[f,x]
? If you are ensuring there are no lingering definitions, then probably address all the symbols involved?
$endgroup$
– rhermans
Aug 2 at 9:23
add a comment |
$begingroup$
There are couple of problems with your code.
- It is an image, it would be way nicer not to have to rewrite it.
Plotting
Series
If you go to ref / Series / Application you will see that
Normal
is used to plot aSeries
as otherwiseO[x]^n
will makePlot
confused.Function definition
Functions are defined more or less like that
f[x_]:=...
but ifx
is an argument to your function thenSeries
specx,1,4
will become invalid asx
will be replace with the passed value.You need to create series before you pass the value. One way to do this is to create series once for all by doing it during definition:
=
vs:=
:
So a 'proper way' to get what you need is:
ClearAll[f];
f[x_] = Normal @ Series[E^(-x/4) Sin[3 x], x, 1, 4]
Plot[f[x], x, 0, 6]
Coincidentally you original code was close to working, if you know what is going on:
ClearAll[f];
f[x] := Series[E^(-x/4) Sin[3 x], x, 1, 4]
Plot[Evaluate@Normal@f[x], x, 0, 6]
But this is not a way to go anyway.
$endgroup$
1
$begingroup$
ClearAll[f,x]
? If you are ensuring there are no lingering definitions, then probably address all the symbols involved?
$endgroup$
– rhermans
Aug 2 at 9:23
add a comment |
$begingroup$
There are couple of problems with your code.
- It is an image, it would be way nicer not to have to rewrite it.
Plotting
Series
If you go to ref / Series / Application you will see that
Normal
is used to plot aSeries
as otherwiseO[x]^n
will makePlot
confused.Function definition
Functions are defined more or less like that
f[x_]:=...
but ifx
is an argument to your function thenSeries
specx,1,4
will become invalid asx
will be replace with the passed value.You need to create series before you pass the value. One way to do this is to create series once for all by doing it during definition:
=
vs:=
:
So a 'proper way' to get what you need is:
ClearAll[f];
f[x_] = Normal @ Series[E^(-x/4) Sin[3 x], x, 1, 4]
Plot[f[x], x, 0, 6]
Coincidentally you original code was close to working, if you know what is going on:
ClearAll[f];
f[x] := Series[E^(-x/4) Sin[3 x], x, 1, 4]
Plot[Evaluate@Normal@f[x], x, 0, 6]
But this is not a way to go anyway.
$endgroup$
There are couple of problems with your code.
- It is an image, it would be way nicer not to have to rewrite it.
Plotting
Series
If you go to ref / Series / Application you will see that
Normal
is used to plot aSeries
as otherwiseO[x]^n
will makePlot
confused.Function definition
Functions are defined more or less like that
f[x_]:=...
but ifx
is an argument to your function thenSeries
specx,1,4
will become invalid asx
will be replace with the passed value.You need to create series before you pass the value. One way to do this is to create series once for all by doing it during definition:
=
vs:=
:
So a 'proper way' to get what you need is:
ClearAll[f];
f[x_] = Normal @ Series[E^(-x/4) Sin[3 x], x, 1, 4]
Plot[f[x], x, 0, 6]
Coincidentally you original code was close to working, if you know what is going on:
ClearAll[f];
f[x] := Series[E^(-x/4) Sin[3 x], x, 1, 4]
Plot[Evaluate@Normal@f[x], x, 0, 6]
But this is not a way to go anyway.
answered Aug 1 at 7:40
Kuba♦Kuba
111k12 gold badges220 silver badges563 bronze badges
111k12 gold badges220 silver badges563 bronze badges
1
$begingroup$
ClearAll[f,x]
? If you are ensuring there are no lingering definitions, then probably address all the symbols involved?
$endgroup$
– rhermans
Aug 2 at 9:23
add a comment |
1
$begingroup$
ClearAll[f,x]
? If you are ensuring there are no lingering definitions, then probably address all the symbols involved?
$endgroup$
– rhermans
Aug 2 at 9:23
1
1
$begingroup$
ClearAll[f,x]
? If you are ensuring there are no lingering definitions, then probably address all the symbols involved?$endgroup$
– rhermans
Aug 2 at 9:23
$begingroup$
ClearAll[f,x]
? If you are ensuring there are no lingering definitions, then probably address all the symbols involved?$endgroup$
– rhermans
Aug 2 at 9:23
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f203084%2fgeneralivar-0-is-not-a-valid-variable-when-using-series-in-plot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
5
$begingroup$
Use
f[x_] := ...
notf[x] := ...
. Please see Defining functions.$endgroup$
– Szabolcs
Aug 1 at 5:39
1
$begingroup$
@Szabolcs and others, I reopened the question because that comment is not an answer. As shown in the last code block in my answer it does not even need to be a part of the answer. I believe voters were influenced by your comment but I won't reopen it again if it gets closed again.
$endgroup$
– Kuba♦
Aug 1 at 9:14
$begingroup$
Please include the message name to make it easier for others who have the same problem to search for and find this question
$endgroup$
– Michael E2
Aug 1 at 11:47
$begingroup$
@Kuba Duplicate?: mathematica.stackexchange.com/q/48980/4999
$endgroup$
– Michael E2
Aug 1 at 11:49
$begingroup$
Related: mathematica.stackexchange.com/q/1301/4999
$endgroup$
– Michael E2
Aug 1 at 11:53