Mathematica中文论坛-非官方

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 14937|回复: 0
打印 上一主题 下一主题

豆粑粑 matlab 画势能面

[复制链接]

532

主题

602

帖子

3031

积分

论坛元老

Rank: 8Rank: 8

积分
3031
跳转到指定楼层
楼主
发表于 2018-11-21 09:33:15 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
别人的问题,记录一下。

这是个记录的帖子:
等我不在这个世界上的时候,希望有人能通过这个帖子的内容,少走些弯路,多学些。


用surf画势能面。分别调整透明程度。
用surf画原子。
用text标注。
设置其它。


  1. clear all
  2. clc
  3. clf

  4. %% outline
  5. % plot diff layer potential surfs

  6. %% main
  7. % the x,y
  8. x=[1:10];
  9. y=[0:8];
  10. [X,Y]=meshgrid(x,y);

  11. % your potential values,
  12. Z1  = sin(0.2*X+0.7*Y );
  13. Z2  = exp(0.1*X.*cos(0.5*Y.^1.1))+3;
  14. Z3  = 0.1*((X-5).^2 + (Y-6).^2)+7;

  15. % atom x,y,z
  16. [s_x,s_y,s_z]=sphere(50);
  17. x_shift = 3;
  18. y_shift = 2;
  19. z_shift = 12;
  20. r=0.6;


  21. %% plot
  22. hold on
  23. % surf 3 layers
  24. h1=surf(X,Y,Z1);
  25. h2=surf(X,Y,Z2,Z2+10); % you can modify 10 to change the color of the layer
  26. h3=surf(X,Y,Z3,Z3+20); % you can modify 20 to change the color of the layer

  27. alpha(h1,0.95);
  28. alpha(h2,0.9);
  29. alpha(h3,0.8);

  30. % plot atom
  31. surf(r*s_x+x_shift,r*s_y+y_shift,r*s_z+z_shift,'edgecolor','none','markerfacecolor','w')

  32. % Text
  33. text(3,4,10,'S_2','fontsize',16)


  34. % plot point on surf
  35. plot3(X(6,5),Y(6,5),Z3(6,5),'yo','markerfacecolor','y','markersize',10);

  36. % other settings
  37. view(150,30);
  38. axis off
  39. axis equal
  40. camlight


  41. h=gcf;
  42. fi_na = 'fig_3layers_pot'
  43. fun_work_li_035_myfig_out(h,fi_na,3)
  44. %% logs
  45. % mod : 2018年 11月 21日 星期三 08:52:09 CST
  46. % mod by mm
  47. % contact : meatball1982@163.com
复制代码


fig_3layers_pot.png (145.11 KB, 下载次数: 1647)

fig_3layers_pot.png
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|Mathematica中文论坛-非官方 ( 辽ICP备16001491号-1

GMT+8, 2024-4-27 06:10 , Processed in 0.114744 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表