gpt4 book ai didi

GNUPLOT - "set dummy"的问题

转载 作者:行者123 更新时间:2023-12-04 09:07:48 24 4
gpt4 key购买 nike

嘿,我想绘制一些函数,但我的虚拟变量有问题。每次我想绘制我的第二个图形 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你只能使用一个。

关于GNUPLOT - "set dummy"的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63415025/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com