声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

声振论坛 展示 科学计算 Mathematica 查看内容

Mathematica的常见问题

2015-10-29 00:42| 发布者: aspen| 查看: 1040| 评论: 3|原作者: aspen|来自: 声振论坛

摘要: 以前只有matlab的常见问题,现在也有Mathematica的常见问题 1).Mathematica 可以定义变量 ...
以前只有matlab的常见问题,现在也有Mathematica的常见问题
>************************************************************************<

=================================== - [返回]
1).Mathematica 可以定义变量为实数么?
:#FangQ(Qianqian.Fang@dartmouth.edu), 2002/6/22.BigGreen/en_Mathematica #

1. 在Simplify/FullSimplify可以使用\[Element],如
Simplify[Re[a+b*I],a\[Element]Reals]
2. 可以使用ComplexExpand[]来展开表达式,默认:符号均为实数:
Unprotect[Abs];
Abs[x_] := Sqrt[Re[x]^2 + Im[x]^2];
ComplexExpand[Abs[a + b*I], a]
3. 使用/:,对符号关联相应的转换规则
x /: Im[x] = 0;
x /: Re[x] = x;
y /: Im[y] = 0;
y /: Re[y] = y;
Re[x+y*I]


=================================== - [返回]
2).Mathematica中如何中断运算?
:#FangQ(Qianqian.Fang@dartmouth.edu), 2002/6/22.BigGreen/en_Mathematica#

Alt+. 直接终止当前执行的运算
Alt+, 询问是否终止或者继续
如果不能终止,用菜单Kernel\Quit Kernal\Local来退出当前运算


=================================== - [返回]
3).请高手推荐Mathematica参考书
:#FangQ(Qianqian.Fang@dartmouth.edu), 2002/6/22.BigGreen/en_Mathematica#

我迄今为止看到的最好的一本就是Mathematica自己带的帮助里面
的The Mathematica Book,内容全面,循序渐近,非常容易学习使用
。其他所见到的一些中文书籍基本上都是直接翻译帮助的内容,没有
什么新意。


=================================== - [返回]
4).请问在Mathematica中如何画极坐标图?
:#FangQ(Qianqian.Fang@dartmouth.edu), 2002/6/4. SMTH/MathTools #

<< Graphics`Graphics`
PolarPlot[]
PolarListPlot[]


=================================== - [返回]
5).Mathematica中如何对离散点作积分?
:#FangQ(Qianqian.Fang@dartmouth.edu), 2002/5/9. SMTH/MathTools#


离散的点通过插值或者拟合就可以得到连续的函数,然后可以对该函
数求积分和微分。下面是一个例子:

f[x_] := NIntegrate[Sin[Cos[x]], {x, 0, a}];
data = Table[{a, f[x]}, {a, 0, 10}];
expr = Interpolation[data];

Plot[expr[a], {a, 0, 10}];
Plot[Evaluate[D[expr[a], a]], {a, 0, 10}]

如果想实现Matlab中的cumsum的功能:
Drop[FoldList[Plus, 0, {a1,a2,…,an}], 1]


=================================== - [返回]
6).在Mathematica中创立palette?
:#FangQ(Qianqian.Fang@dartmouth.edu), 2002/6/18. SMTH/MathTools#

在帮助中查找"Creating Palettes (Windows)"


=================================== - [返回]
7).Mathematica可以作用户界面吗?
:#FangQ(Qianqian.Fang@dartmouth.edu), 2002/5/31. SMTH/MathTools#

Mathematica的GUI设计是通过它的交互式的NoteBook实现的,可以参
考Mathematica帮助文件中的demo例子,或参考帮助2.10.6

=================================== - [返回]
8).Mathematica中如何使用中文?
:#FangQ(Qianqian.Fang@dartmouth.edu), 2002/7/23. BigGreen/en_Mathematica#

Mathematica3/4/4.1中如果使用中文,需要先选中所在的cell,或者选中
输入的中文乱码,在菜单format font中选中对应的中文字体后才能正确
显示。

最新的4.2在国际化有较大的改进,可以直接输入中文,参见
http://www.wolfram.com/products/mathematica/newin42/publishing.html<;/A>

=================================== - [返回]
9)..Mathematica中如何使用Solve[]求解的结果?(FangQ)
:#FangQ(
Qianqian.Fang@dartmouth.edu), 2002/11/19. BigGreen/en_Mathematica#

Solve[]求解的结果是以一个"表"或者"替换规则"的形式给出来的,
并没有把结果真正替换给未知量。如果

sol = Solve[a*x^2 + b*x + c == 0, x];
x=x /. sol[[1]]

也可以使用对表元素的操作把结果取出来,比如在上面的例子中:

x1=sol[[1,1,2]]
x2=sol[[2,1,2]]
发表评论

最新评论

引用 heu_hky 2005-7-14 15:48
hao
引用 zyl-jd2000 2008-1-13 20:52
有一本书强烈推荐《数学运算大师MATHEMATIC4.0》
引用 suffer 2008-1-15 15:48
原帖由 zyl-jd2000 于 2008-1-13 20:52 发表
有一本书强烈推荐《数学运算大师MATHEMATIC4.0》

最好给出该书的详细介绍

查看全部评论(3)

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-3 06:23 , Processed in 0.098658 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部