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;








3












$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.




enter image description here



How can I fix this error?










share|improve this question











$endgroup$









  • 5




    $begingroup$
    Use f[x_] := ... not f[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

















3












$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.




enter image description here



How can I fix this error?










share|improve this question











$endgroup$









  • 5




    $begingroup$
    Use f[x_] := ... not f[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













3












3








3





$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.




enter image description here



How can I fix this error?










share|improve this question











$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.




enter image description here



How can I fix this error?







plotting error variable






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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$
    Use f[x_] := ... not f[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




    $begingroup$
    Use f[x_] := ... not f[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










1 Answer
1






active

oldest

votes


















11












$begingroup$

There are couple of problems with your code.



  1. It is an image, it would be way nicer not to have to rewrite it.


  2. Plotting Series



    If you go to ref / Series / Application you will see that Normal is used to plot a Series as otherwise O[x]^n will make Plot confused.




  3. Function definition



    Functions are defined more or less like that f[x_]:=... but if x is an argument to your function then Series spec x,1,4 will become invalid as x 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]


enter image description here



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.






share|improve this answer









$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













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
);



);













draft saved

draft discarded


















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









11












$begingroup$

There are couple of problems with your code.



  1. It is an image, it would be way nicer not to have to rewrite it.


  2. Plotting Series



    If you go to ref / Series / Application you will see that Normal is used to plot a Series as otherwise O[x]^n will make Plot confused.




  3. Function definition



    Functions are defined more or less like that f[x_]:=... but if x is an argument to your function then Series spec x,1,4 will become invalid as x 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]


enter image description here



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.






share|improve this answer









$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















11












$begingroup$

There are couple of problems with your code.



  1. It is an image, it would be way nicer not to have to rewrite it.


  2. Plotting Series



    If you go to ref / Series / Application you will see that Normal is used to plot a Series as otherwise O[x]^n will make Plot confused.




  3. Function definition



    Functions are defined more or less like that f[x_]:=... but if x is an argument to your function then Series spec x,1,4 will become invalid as x 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]


enter image description here



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.






share|improve this answer









$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













11












11








11





$begingroup$

There are couple of problems with your code.



  1. It is an image, it would be way nicer not to have to rewrite it.


  2. Plotting Series



    If you go to ref / Series / Application you will see that Normal is used to plot a Series as otherwise O[x]^n will make Plot confused.




  3. Function definition



    Functions are defined more or less like that f[x_]:=... but if x is an argument to your function then Series spec x,1,4 will become invalid as x 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]


enter image description here



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.






share|improve this answer









$endgroup$



There are couple of problems with your code.



  1. It is an image, it would be way nicer not to have to rewrite it.


  2. Plotting Series



    If you go to ref / Series / Application you will see that Normal is used to plot a Series as otherwise O[x]^n will make Plot confused.




  3. Function definition



    Functions are defined more or less like that f[x_]:=... but if x is an argument to your function then Series spec x,1,4 will become invalid as x 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]


enter image description here



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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 1 at 7:40









KubaKuba

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












  • 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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?