当前位置:网站首页>Disorganized series
Disorganized series
2022-07-05 17:42:00 【Selvaggia】
Hands-on practice
solve、dsolve
clc,clear;
syms m V rho g k;
% Solving differential equations ( The solution is to satisfy the differential equation The relationship between variables )
dsolve('Dy==5') %dy/dt=5
dsolve('Dy==x','x') %dy/dx=x If no variable is specified, it defaults to t
dsolve('D2y==1+Dy','y(0)==1','Dy(0)==0')%d2y/dt2=1+dy/dt, Initial conditions y(0)=1,dy(0)/dt=0
[y1,y2]=dsolve('Dx==y+x','Dy==2*x','x(0)==0','y(0)==1')%dx/dt=y+x,dy/dt=2*x,x(0)=0,y(0)=1,x=y5,y=y6
% Symbolic variables are defined in advance , You can write an expression directly in function brackets , No quotes ;
% If there is no definition, put it in quotation marks
%solve Solution of general equations
syms x y a;
eq=x^2+2*x+1;
s1=solve(eq,x)
eq=a*x+2;
s2=solve(eq,a)
eq1=x+2*y-8; % Solve a system of binary first-order equations , Solution is a structure
eq2=3*x+5*y-4;
s3=solve(eq1,eq2,x,y);% Only s3 Bearing result s3 For vector group , You can use [x,y] Undertaking
s3=[s3.x,s3.y]
s1=solve(sin(x)==1/2)
s2=solve(x^3-1==0)
%ode For solving numerical solutions of differential equations , See for example CSDN, The point is
% Standard form of differential equation , You can always find multiple variables Such as F(y,y',y'',y''',…,t)=0
%y,y',y'',y''' It's a variable , To set a vector , Do variable substitution
% Like a vector x: x(1)=y,x(2)=y'
%ode45 The main part of the function List each variable separately Yes t Derivative d x(2) The expression of
vpa,simplify,subs
syms x y z
f=cos(x)^2-sin(x)^2
s1 = simplify(f)
s1 = cos(2*x)
% Do not match the file name with matlab The inherent function name is the same !!!
clc,clear;
syms m V rho g k;
s=dsolve('m*D2s=m*g-rho*g*V-k*Ds','s(0)=0','Ds(0)=0')
% The differential equation has only one variable s, Or say The solution of the differential equation is s And t The relation of
s=subs(s,{
m,V,rho,g,k},{
239.46,0.2058,1035.71,9.8,0.6})
% R = subs(S, old, new) utilize new Instead of the symbol ! expression ! in old Value
s=vpa(s,10)
% The exact solution obtained when using symbolic calculation will show scores , It can be used vpa Convert to decimal display
%vpa The action object can be numeric or ! expression !( Numerical precision in expressions )( Significant figures )
%s=dsolve('m*DV==m*g-rho*g*V-K*V')
syms f(x)
a=1/99
x=sym(1/2)
y=vpa(x)
边栏推荐
- 中国银河证券开户安全吗 开户后多久能买股票
- ICML 2022 | Meta提出鲁棒的多目标贝叶斯优化方法,有效应对输入噪声
- WR | Jufeng group of West Lake University revealed the impact of microplastics pollution on the flora and denitrification function of constructed wetlands
- 7 pratiques devops pour améliorer la performance des applications
- WebApp开发-Google官方教程
- Cloud security daily 220705: the red hat PHP interpreter has found a vulnerability of executing arbitrary code, which needs to be upgraded as soon as possible
- 統計php程序運行時間及設置PHP最長運行時間
- 漫画:寻找股票买入卖出的最佳时机
- 33: Chapter 3: develop pass service: 16: use redis to cache user information; (to reduce the pressure on the database)
- QT console printout
猜你喜欢

Kafaka技术第一课
In depth understanding of redis memory obsolescence strategy

企业数字化发展中的六个安全陋习,每一个都很危险!

Knowledge points of MySQL (7)

7. Scala class

提高應用程序性能的7個DevOps實踐

ICML 2022 | Meta提出魯棒的多目標貝葉斯優化方法,有效應對輸入噪聲

VBA drives SAP GUI to realize office automation (II): judge whether elements exist

Machine learning 02: model evaluation

论文阅读_中文NLP_LTP
随机推荐
Disabling and enabling inspections pycharm
Winedt common shortcut key modify shortcut key latex compile button
云主机oracle异常恢复----惜分飞
Beijing internal promotion | the machine learning group of Microsoft Research Asia recruits full-time researchers in nlp/ speech synthesis and other directions
忽米沄析:工业互联网标识解析与企业信息系统的融合应用
Tita 绩效宝:如何为年中考核做准备?
机器学习02:模型评估
漫画:寻找无序数组的第k大元素(修订版)
Cartoon: a bloody case caused by a math problem
Accuracy of BigDecimal Division
7 pratiques devops pour améliorer la performance des applications
漫画:如何实现大整数相乘?(下)
How MySQL uses JSON_ Extract() takes JSON value
Matery主题自定义(一)黑夜模式
解决“双击pdf文件,弹出”请安装evernote程序
北京内推 | 微软亚洲研究院机器学习组招聘NLP/语音合成等方向全职研究员
7. Scala class
MySQL queries the latest qualified data rows
Use of ThinkPHP template
蚂蚁金服的暴富还未开始,Zoom的神话却仍在继续!