Skip to main content
Post Closed as "Not suitable for this site" by Artes, Bob Hanlon, bbgodfrey, Rohit Namjoshi, MarcoB
Became Hot Network Question
added 1165 characters in body
Source Link
Casper
  • 143
  • 3

enter image description here

f[x_] = x^4; a = -1; b = 1; L = 1; 
gr = Plot[f[x], {x, a, b}, PlotRange -> {{a, b}, {-0.2, 1}}, 
   PlotStyle -> {Hue[0.02], Thickness[0.007]}];

a0 = 1/L \!\(
\*SubsuperscriptBox[\(\[Integral]\), \(-1\), \(1\)]\(f[
      x] \[DifferentialD]x\)\);
a[n_] = 1/L \!\(
\*SubsuperscriptBox[\(\[Integral]\), \(-1\), \(1\)]\(f[x]*Cos[
\*FractionBox[\(n*\[Pi]\), \(L\)]*x] \[DifferentialD]x\)\);
b[n_] = 1/L \!\(
\*SubsuperscriptBox[\(\[Integral]\), \(-1\), \(1\)]\(f[x]*Sin[
\*FractionBox[\(n*\[Pi]\), \(L\)]*x] \[DifferentialD]x\)\);
\[CapitalPhi][x, k] = a0/2 + \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(k\)]\((a[n]*Cos[
\*FractionBox[\(n*\[Pi]*x\), \(L\)]] + b[n]*Sin[
\*FractionBox[\(n*\[Pi]*x\), \(L\)]])\)\) // N;
\[CapitalPhi]1 = a0/2 + \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(1\)]\((a[n]*Cos[
\*FractionBox[\(n*\[Pi]*x\), \(L\)]] + b[n]*Sin[
\*FractionBox[\(n*\[Pi]*x\), \(L\)]])\)\) // N;

gr1 = Plot[\[CapitalPhi]1, {x, a, b}, 
  PlotStyle -> {Hue[0.1], Dashing[{0.03}], Thickness[0.01]}]

There are errors like inI'm a beginner, I was given a lab, I copied exactly the code from the picture that the teacher sent us, please helpbut my code does not work like his. Unfortunately, I don't understand whatcan't ask him about my mistake, so I'm doing wrong(asking here

enter image description here

There are errors like in the picture, please help. I don't understand what I'm doing wrong(

enter image description here

f[x_] = x^4; a = -1; b = 1; L = 1; 
gr = Plot[f[x], {x, a, b}, PlotRange -> {{a, b}, {-0.2, 1}}, 
   PlotStyle -> {Hue[0.02], Thickness[0.007]}];

a0 = 1/L \!\(
\*SubsuperscriptBox[\(\[Integral]\), \(-1\), \(1\)]\(f[
      x] \[DifferentialD]x\)\);
a[n_] = 1/L \!\(
\*SubsuperscriptBox[\(\[Integral]\), \(-1\), \(1\)]\(f[x]*Cos[
\*FractionBox[\(n*\[Pi]\), \(L\)]*x] \[DifferentialD]x\)\);
b[n_] = 1/L \!\(
\*SubsuperscriptBox[\(\[Integral]\), \(-1\), \(1\)]\(f[x]*Sin[
\*FractionBox[\(n*\[Pi]\), \(L\)]*x] \[DifferentialD]x\)\);
\[CapitalPhi][x, k] = a0/2 + \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(k\)]\((a[n]*Cos[
\*FractionBox[\(n*\[Pi]*x\), \(L\)]] + b[n]*Sin[
\*FractionBox[\(n*\[Pi]*x\), \(L\)]])\)\) // N;
\[CapitalPhi]1 = a0/2 + \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(1\)]\((a[n]*Cos[
\*FractionBox[\(n*\[Pi]*x\), \(L\)]] + b[n]*Sin[
\*FractionBox[\(n*\[Pi]*x\), \(L\)]])\)\) // N;

gr1 = Plot[\[CapitalPhi]1, {x, a, b}, 
  PlotStyle -> {Hue[0.1], Dashing[{0.03}], Thickness[0.01]}]

I'm a beginner, I was given a lab, I copied exactly the code from the picture that the teacher sent us, but my code does not work like his. Unfortunately, I can't ask him about my mistake, so I'm asking here

Source Link
Casper
  • 143
  • 3

NSum::nslim: Limit of summation k is not a number. Help, please(

enter image description here

There are errors like in the picture, please help. I don't understand what I'm doing wrong(