![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Mathematica经验
zhenyan_cy
这个作者很懒,什么都没留下…
展开
-
mathematica或mathtype的一些快捷键
快捷键原创 2022-08-25 22:23:15 · 2526 阅读 · 0 评论 -
mathematica中在Plot中画平行于y轴的线
简单plot画图原创 2022-08-07 15:11:53 · 791 阅读 · 0 评论 -
mathematica中画二维不规则区域图——黑白图
在mathematica中画二维黑白不规则区域图原创 2022-07-15 10:17:53 · 1396 阅读 · 0 评论 -
mathematica中画图技巧
mathematica画图原创 2022-06-17 15:34:36 · 1046 阅读 · 0 评论 -
mathematica里面如何判断两个可行域的包含关系
利用函数:Implies结合:ForAll(类似数学里面的任意)和Resolve示例如下:Clear["`*"];Resolve[ForAll[{x, y}, Implies[x^2 + 2 y^2 < 1, x^2 + y^2 < 1]]]Resolve[ForAll[{x, y}, Implies[x^2 + y^2 < 1, x^2 + 2 y^2 < 1]]]RegionPlot[{x^2 + y^2 < 1, x^2 + 2 y^2 < 1}转载 2022-04-15 15:04:39 · 252 阅读 · 0 评论 -
mathematica中画一条垂直于x轴或y轴的平行线
函数:ContourPlot示例代码Clear["`*"];a = 1;c = -2;ContourPlot[{x == a + c, y == 2*a + 3*c}, {x, -5, 5}, {y, -5, 5}, Axes -> True, Frame -> False, PlotLegends -> {"1", "2"}]ContourPlot[{x == a + c, x == 2*a + 3*c, y == a + c, y == 2*a + 3*原创 2022-03-15 16:28:24 · 2645 阅读 · 0 评论 -
Animate中嵌套使用
由于下面这种形式利用Animate不可以运行(但是Manipulate可以运行),示例代码:Clear["`*"];f[x_, a_, b_, c_] = a*x^2 + b*x + c;Animate[Plot[f[x, a, b, c], {x, -2, 1}], {a, c, 2}, {b, -3, c}, {c, 1, 7}]Manipulate[ Plot[f[x, a, b, c], {x, -2, 1}], {a, c, 2}, {b, -3, c}, {c, 1, 7}]原创 2022-03-02 14:33:17 · 374 阅读 · 0 评论 -
mathematica中快捷键
1.运行快捷键Shift+Enter2.强制结束运行Alt+.3.分数形式Ctrl+/4.注释选中要注释的部分,Alt+/原创 2022-02-28 17:02:30 · 4387 阅读 · 0 评论 -
Mathematica中数据类型的互换——实数(即小数)to有理数(即分数),有理数(即分数)to实数(即小数)
1.变成实数(即小数)N[x,n],其中x为需要转变的数,n为误差或简化的N[x],不需要误差代码示例Clear["`*"];N[1/7]结果如下2.变成分数(即有理数)Rationalize[x,n],其中x为需要转变的数,n为误差或简化的Rationalize[x],不需要误差代码示例Clear["`*"];Rationalize[6.75]结果如下...原创 2022-02-20 14:14:01 · 4028 阅读 · 0 评论 -
mathematica中如何在定义函数时定义变量的类型———Integer或Rational等
在定义变量的时候在下划线后面加上数据类型参考链接mathematica中的一些数据类型代码示例Clear["`*"];F[z_] = z^3;F[3]F[3.5]F[0]F[7/2]f[x_Integer] = x^3;f[3]f[3.5]g[y_Rational] = y^3;g[3]g[3.5]g[7/2]g[1/1000]g[0 + 1/1000]gg[x_Integer, y_Rational] = f[x] + g[y];gg[1, 1/2].原创 2022-02-19 19:45:56 · 2414 阅读 · 0 评论 -
mathematica中同时判断多个函数——可变动参数的情况
利用Manipulate和Animate函数代码示例:Clear["`*"];Manipulate[{Reduce[ Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}][[2, 1, 2]] > 0], Reduce[Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}][[2, 1, 2]] == 0], Reduce[Maximize[{a*x^2 - b, 0 <= x <= 1原创 2022-02-19 15:43:50 · 857 阅读 · 0 评论 -
mathematica动态求解函数的最值或判断-不画图
利用函数Manipulate或Animate代码示例:Clear["`*"];Manipulate[x^2, {x, 0, 1}]Manipulate[a*x^2, {x, 0, 1}, {a, -1, 1}]Manipulate[ Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}], {a, -1, 1}, {b, -1, 1}]Manipulate[ Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}][原创 2022-02-19 14:55:38 · 986 阅读 · 0 评论 -
Mathematica中将多个动态图合并在一起(包括自动与手动)
说明:在mathematica中,一般我们需要查看变动某个函数的某个或某几个参数时,图形的变化情况,我们可以采用函数Manipulate(手动变化参数,即静态图)或Animate(自动变化参数,即动态图)1.给定外生参数的函数图示例代码:Clear["`*"];k=1;P=Plot[Sin[x + k], {x, 0, 2 Pi}];G=Graphics[Circle[{k, 0}, 1], PlotRange -> {{0, 2 Pi}, {-1.2, 1.2}}];Sh原创 2022-01-24 23:12:35 · 3265 阅读 · 0 评论 -
Mathematica二维画图一些技巧
二维画图函数RegionPlot:mathematica的RegionPlot函数在线中文教程1.简单画图代码:RegionPlot[x^2 + y^3 < 2, {x, -2, 2}, {y, -2, 2}]对应的结果如下:2.添加网格线代码:Clear["`*"];RegionPlot[x^2 + y^3 < 2, {x, -2, 2}, {y, -2, 2}, Mesh -> {{{0, Red}, {1, Red}}, {{1, Black原创 2022-01-24 19:07:53 · 4416 阅读 · 0 评论 -
Mathematica三维画图一些技巧
三维画图函数Plot3D:mathematica的Plot3D函数在线中文教程1.最简单的画图代码:Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, Mesh -> None]对应的结果:2.添加网格线代码:Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, Mesh -> {{{0, Thick}, {1, Thick}}, {{0, Red}}}]对应的结果:3.原创 2022-01-24 17:48:01 · 9131 阅读 · 0 评论