GNUPLOT - "set dummy" 的问题

GNUPLOT - problems with "set dummy"

嘿,我想绘制一些函数,但我的虚拟变量有问题。每次我想绘制我的第二个图形时,gnuplot 都会说虚拟 M 或 x 未定义,但我不知道为什么。不需要有不同的虚拟变量,但它有助于跟踪事物。否则我想了解为什么我的代码不适用于进一步的情节。对我来说,虚拟变量只是一个变量,用于我绘图上 x 轴上的每个点。也许我错了? 我希望有人能帮助我吗?

reset
set term qt

d = 0.01
G = 81.0E9
k = 2.02
g = 9.81
E = 210.0E9
v = 0.28
A = 0.12 * 0.12
tau_max = 100.0E6
U0 = 3.0

IP = pi * d / 32.0

#Plot und Berechnung für die Wägezelle

set title "Wägezelle - U_B/U_0" font "times new roman, 30"
set xrange [0:10.0]
set yrange [0:45.0]
set xlabel "m [kg]" font "times new roman, 25"
set ylabel "U_{Bsoll}/U_0 * 10^9" offset -5 font "times new roman, 25"
set xtics nomirror font "times new roman, 20"
set ytics 5 font "times new roman, 20"

set lmargin 15
set bmargin 5

set dummy m

y(m) = m * g * (1 + v) * k / 2 / E / A * 1E9

plot \
y(m) w l lc "red" lw 2 notitle

pause mouse any

#Plot und Berechnung Torsionsstab

set title "Drehmoment" font "times new roman, 30"
set xrange []
set yrange []
set xlabel "" font "times new roman, 25"
set ylabel "" font "times new roman, 25"
set xtics font "times new roman, 20"
set ytics font "times new roman, 20"

set dummy ,M,x

tau(M) = M * d / 2 / IP
epsilon(M) = M * d / 4 / G / IP

 Ub(x) = k * epsilon(M) * U0

plot \
epsilon(M) w l lc "blue" title "{/symbol e}_(M)",\
tau(M) w l lc "red" title "{/symbol t}_(M)"

pause mouse any

#plot \
#Ub(x) w l

pause mouse any

据我了解help dummy您只能为plot设置一个虚拟变量,例如plot xsplot 的两个变量,例如splot x*y。对于参数模式,plot 的标准虚拟变量是 tsplot u,v.

来自 help dummy:

By default, gnuplot assumes that the independent, or "dummy", variable for the plot command is "t" if in parametric or polar mode, or "x" otherwise. Similarly the independent variables for the splot command are "u" and "v" in parametric mode (splot cannot be used in polar mode), or "x" and "y" otherwise.

It may be more convenient to call a dummy variable by a more physically meaningful or conventional name.

之前您设置了 set dummy m 并且 set dummy ,M,x 您试图设置 3 个虚拟变量。因此 plot M 将不起作用,因为 m 仍然是第一个虚拟变量,无论如何对于 plot 你只能使用一个。