Skip to main content
added 862 characters in body
Source Link
cvgmt
  • 91.7k
  • 6
  • 113
  • 194

Animation

Clear[np, f, q, p, g, plot]; np = 2; f[pc_] := 1; q[d_, pc_] := (pc/(100*0.48))* Sum[((Pi/4)*(d - (2*n*0.48))^2), {n, 1, np}]; p[d_] := Sum[Pi*(d - (2*n - 1)*0.48), {n, 1, np}]; g[d_, pc_] := q[d, pc]/p[d]; plot[c_] := Plot[Evaluate[Table[g[d, pc], {d, {8, 10, 20}}]], {pc, 0, 50}, MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{c}}, MeshStyle -> {PointSize[Large], Automatic}, PlotRange -> All, AxesLabel -> {"%", "li/lp"}, FrameLabel -> {Style["pc", 12, Bold], Style["li/lp", 12, Bold]}, PlotLabels -> {"d=8", "d=10", "d=20"}, PlotTheme -> "Scientific", GridLines -> Automatic, PlotLabel -> "Razão comprimentos"]; Manipulate[Show[plot[c], Plot[f[pc] + c, {pc, 0, 50}]], {c, -1, 2}, ControlPlacement -> Bottom] 

enter image description here

Animation

Clear[np, f, q, p, g, plot]; np = 2; f[pc_] := 1; q[d_, pc_] := (pc/(100*0.48))* Sum[((Pi/4)*(d - (2*n*0.48))^2), {n, 1, np}]; p[d_] := Sum[Pi*(d - (2*n - 1)*0.48), {n, 1, np}]; g[d_, pc_] := q[d, pc]/p[d]; plot[c_] := Plot[Evaluate[Table[g[d, pc], {d, {8, 10, 20}}]], {pc, 0, 50}, MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{c}}, MeshStyle -> {PointSize[Large], Automatic}, PlotRange -> All, AxesLabel -> {"%", "li/lp"}, FrameLabel -> {Style["pc", 12, Bold], Style["li/lp", 12, Bold]}, PlotLabels -> {"d=8", "d=10", "d=20"}, PlotTheme -> "Scientific", GridLines -> Automatic, PlotLabel -> "Razão comprimentos"]; Manipulate[Show[plot[c], Plot[f[pc] + c, {pc, 0, 50}]], {c, -1, 2}, ControlPlacement -> Bottom] 

enter image description here

added 583 characters in body
Source Link
cvgmt
  • 91.7k
  • 6
  • 113
  • 194

Method 1

Here we plot the intersection of three functions g[8,pc], g[10,pc], g[20,pc] respect tof[pc].

For example,if we want to find the intersetion of g[8,pc] and y=f[x] when we plot g[8,pc], we can set the MeshFunction of g[8,pc] to y-f[x],that is MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}

np = 2; f[pc_] := 1; q[d_, pc_] := (pc/(100*0.48))* Sum[((Pi/4)*(d - (2*n*0.48))^2), {n, 1, np}]; p[d_] := Sum[Pi*(d - (2*n - 1)*0.48), {n, 1, np}]; g[d_, pc_] := q[d, pc]/p[d]; plot = Plot[Evaluate[Table[g[d, pc], {d, {8, 10, 20}}]], {pc, 0, 50}, MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}, MeshStyle -> {PointSize[Large], Automatic}, PlotRange -> All, AxesLabel -> {"%", "li/lp"}, FrameLabel -> {Style["pc", 12, Bold], Style["li/lp", 12, Bold]}, PlotLabels -> {"d=8", "d=10", "d=20"}, PlotTheme -> "Scientific", GridLines -> Automatic, PlotLabel -> "Razão comprimentos"] Show[plot, Plot[f[pc], {pc, 0, 50}]] 

enter image description here

Method 2

On the other hand, we can also set three pure functions Table[Function[pc, g[d, pc] - f[pc] // Evaluate], {d, {8, 10, 20}}]

when we plot f[pc] to get the three intersections.

np = 2; f[pc_] := 1; q[d_, pc_] := (pc/(100*0.48))* Sum[((Pi/4)*(d - (2*n*0.48))^2), {n, 1, np}]; p[d_] := Sum[Pi*(d - (2*n - 1)*0.48), {n, 1, np}]; g[d_, pc_] := q[d, pc]/p[d]; Plot[f[pc], {pc, 0, 50}, MeshFunctions -> Table[Function[pc, g[d, pc] - f[pc] // Evaluate], {d, {8, 10, 20}}], Mesh -> {{0}}, MeshStyle -> Directive[PointSize[Large], Red]] 

enter image description here

Here we plot the intersection of three functions g[8,pc], g[10,pc], g[20,pc] respect tof[pc].

For example,if we want to find the intersetion of g[8,pc] and y=f[x] when we plot g[8,pc], we can set the MeshFunction of g[8,pc] to y-f[x],that is MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}

np = 2; f[pc_] := 1; q[d_, pc_] := (pc/(100*0.48))* Sum[((Pi/4)*(d - (2*n*0.48))^2), {n, 1, np}]; p[d_] := Sum[Pi*(d - (2*n - 1)*0.48), {n, 1, np}]; g[d_, pc_] := q[d, pc]/p[d]; plot = Plot[Evaluate[Table[g[d, pc], {d, {8, 10, 20}}]], {pc, 0, 50}, MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}, MeshStyle -> {PointSize[Large], Automatic}, PlotRange -> All, AxesLabel -> {"%", "li/lp"}, FrameLabel -> {Style["pc", 12, Bold], Style["li/lp", 12, Bold]}, PlotLabels -> {"d=8", "d=10", "d=20"}, PlotTheme -> "Scientific", GridLines -> Automatic, PlotLabel -> "Razão comprimentos"] Show[plot, Plot[f[pc], {pc, 0, 50}]] 

enter image description here

Method 1

Here we plot the intersection of three functions g[8,pc], g[10,pc], g[20,pc] respect tof[pc].

For example,if we want to find the intersetion of g[8,pc] and y=f[x] when we plot g[8,pc], we can set the MeshFunction of g[8,pc] to y-f[x],that is MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}

np = 2; f[pc_] := 1; q[d_, pc_] := (pc/(100*0.48))* Sum[((Pi/4)*(d - (2*n*0.48))^2), {n, 1, np}]; p[d_] := Sum[Pi*(d - (2*n - 1)*0.48), {n, 1, np}]; g[d_, pc_] := q[d, pc]/p[d]; plot = Plot[Evaluate[Table[g[d, pc], {d, {8, 10, 20}}]], {pc, 0, 50}, MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}, MeshStyle -> {PointSize[Large], Automatic}, PlotRange -> All, AxesLabel -> {"%", "li/lp"}, FrameLabel -> {Style["pc", 12, Bold], Style["li/lp", 12, Bold]}, PlotLabels -> {"d=8", "d=10", "d=20"}, PlotTheme -> "Scientific", GridLines -> Automatic, PlotLabel -> "Razão comprimentos"] Show[plot, Plot[f[pc], {pc, 0, 50}]] 

enter image description here

Method 2

On the other hand, we can also set three pure functions Table[Function[pc, g[d, pc] - f[pc] // Evaluate], {d, {8, 10, 20}}]

when we plot f[pc] to get the three intersections.

np = 2; f[pc_] := 1; q[d_, pc_] := (pc/(100*0.48))* Sum[((Pi/4)*(d - (2*n*0.48))^2), {n, 1, np}]; p[d_] := Sum[Pi*(d - (2*n - 1)*0.48), {n, 1, np}]; g[d_, pc_] := q[d, pc]/p[d]; Plot[f[pc], {pc, 0, 50}, MeshFunctions -> Table[Function[pc, g[d, pc] - f[pc] // Evaluate], {d, {8, 10, 20}}], Mesh -> {{0}}, MeshStyle -> Directive[PointSize[Large], Red]] 

enter image description here

deleted 3 characters in body
Source Link
cvgmt
  • 91.7k
  • 6
  • 113
  • 194

Here we plot the intersection of three functions g[8,pc], g[10,pc], g[20,pc] respect tof[pc].

For example,if we want to find the intersetion of g[8,pc] and y=f[x] when we plot g[8,pc], we shouldcan set the MeshFunction of g[8,pc] to y-f[x],that is MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}

np = 2; f[pc_] := 1; q[d_, pc_] := (pc/(100*0.48))* Sum[((Pi/4)*(d - (2*n*0.48))^2), {n, 1, np}]; p[d_] := Sum[Pi*(d - (2*n - 1)*0.48), {n, 1, np}]; g[d_, pc_] := q[d, pc]/p[d]; plot = Plot[Evaluate[Table[g[d, pc], {d, {8, 10, 20}}]], {pc, 0, 50}, MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}, MeshStyle -> {PointSize[Large], Automatic}, PlotRange -> All, AxesLabel -> {"%", "li/lp"}, FrameLabel -> {Style["pc", 12, Bold], Style["li/lp", 12, Bold]}, PlotLabels -> {"d=8", "d=10", "d=20"}, PlotTheme -> "Scientific", GridLines -> Automatic, PlotLabel -> "Razão comprimentos"] Show[plot, Plot[f[pc], {pc, 0, 50}]] 

enter image description here

Here we plot the intersection of three functions g[8,pc], g[10,pc], g[20,pc] respect tof[pc].

For example,if we want to find the intersetion of g[8,pc] and y=f[x] when we plot g[8,pc], we should set the MeshFunction of g[8,pc] to y-f[x],that is MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}

np = 2; f[pc_] := 1; q[d_, pc_] := (pc/(100*0.48))* Sum[((Pi/4)*(d - (2*n*0.48))^2), {n, 1, np}]; p[d_] := Sum[Pi*(d - (2*n - 1)*0.48), {n, 1, np}]; g[d_, pc_] := q[d, pc]/p[d]; plot = Plot[Evaluate[Table[g[d, pc], {d, {8, 10, 20}}]], {pc, 0, 50}, MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}, MeshStyle -> {PointSize[Large], Automatic}, PlotRange -> All, AxesLabel -> {"%", "li/lp"}, FrameLabel -> {Style["pc", 12, Bold], Style["li/lp", 12, Bold]}, PlotLabels -> {"d=8", "d=10", "d=20"}, PlotTheme -> "Scientific", GridLines -> Automatic, PlotLabel -> "Razão comprimentos"] Show[plot, Plot[f[pc], {pc, 0, 50}]] 

enter image description here

Here we plot the intersection of three functions g[8,pc], g[10,pc], g[20,pc] respect tof[pc].

For example,if we want to find the intersetion of g[8,pc] and y=f[x] when we plot g[8,pc], we can set the MeshFunction of g[8,pc] to y-f[x],that is MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}

np = 2; f[pc_] := 1; q[d_, pc_] := (pc/(100*0.48))* Sum[((Pi/4)*(d - (2*n*0.48))^2), {n, 1, np}]; p[d_] := Sum[Pi*(d - (2*n - 1)*0.48), {n, 1, np}]; g[d_, pc_] := q[d, pc]/p[d]; plot = Plot[Evaluate[Table[g[d, pc], {d, {8, 10, 20}}]], {pc, 0, 50}, MeshFunctions -> {#2 - f[#1] &}, Mesh -> {{0}}, MeshStyle -> {PointSize[Large], Automatic}, PlotRange -> All, AxesLabel -> {"%", "li/lp"}, FrameLabel -> {Style["pc", 12, Bold], Style["li/lp", 12, Bold]}, PlotLabels -> {"d=8", "d=10", "d=20"}, PlotTheme -> "Scientific", GridLines -> Automatic, PlotLabel -> "Razão comprimentos"] Show[plot, Plot[f[pc], {pc, 0, 50}]] 

enter image description here

added 33 characters in body
Source Link
cvgmt
  • 91.7k
  • 6
  • 113
  • 194
Loading
added 33 characters in body
Source Link
cvgmt
  • 91.7k
  • 6
  • 113
  • 194
Loading
Source Link
cvgmt
  • 91.7k
  • 6
  • 113
  • 194
Loading