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

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form