当前位置:网站首页>[mathematical modeling summer training] matlab for finding symbolic solutions and numerical solutions of algebraic equations
[mathematical modeling summer training] matlab for finding symbolic solutions and numerical solutions of algebraic equations
2022-07-18 00:07:00 【Lydia. na】
List of articles
Symbolic operations
Symbolic operation is also called computer algebra , Generally speaking, it is to use computers to deduce mathematical formulas , Such as factoring the expression 、 Simplification 、 differential 、 integral 、 Solve algebraic equations 、 Solve ordinary differential equations, etc . Compared with numerical operation , Symbolic computation has the following characteristics :(1) The operation is carried out by reasoning , Therefore, it is not affected by truncation error and cumulative error ;(2) The speed of symbol calculation is relatively slow .
1.1 Creation of symbol objects
stay MATLAB in , Provides two functions for creating symbol objects , namely sym and syms function .
1.sym
sym Function is used to establish a single symbolic quantity , The call format of the function is :
var=sym('var') % Create a symbolic variable var.
symexpr=sym(h) % Create a symbolic expression through the function handle of an anonymous function .
A=sym('a', [m,n]) % Create a m×n Symbolic variable of matrix .
2.syms
sym Functions can only define one symbolic variable at a time , Inconvenient to use . MATLAB Another function is provided syms, Multiple symbolic variables can be defined at a time .
clc, clear
syms a % Define symbolic variables a
syms x y integer % Define integer symbolic variables x and y
syms s(t) f(x,y) % Define two symbolic functions
1.2 Symbolic solutions of algebraic equations
stay MATLAB in , Provides solve Function to solve symbolic algebraic equations or systems of equations , The call format is as follows :
S = s o l v e ( e q n , v a r ) S=solve(eqn,var) S=solve(eqn,var)% Find the expression eqn Algebraic equation of , The solution variable is var.
S = s o l v e ( e q n , v a r , N a m e , V a l u e ) S=solve(eqn,var,Name,Value) S=solve(eqn,var,Name,Value)% Find the expression eqn Algebraic equation of , The solution variable is var, It specifies
One or more attribute value names and their corresponding attribute values .
[ y 1 , … , y N ] [y1,…,yN] [y1,…,yN]=solve(eqns,vars) % Find the expression eqns Algebraic equations of , The solution variable group is vars.
Numerical solutions of algebraic equations
Numerical solutions of linear equations
System of linear equations A x = b Ax = b Ax=b The solution command of is x = p i n v ( A ) ∗ b x=pinv(A)*b x=pinv(A)∗b, When A When the rank is full , You can use commands KaTeX parse error: Undefined control sequence: \b at position 4: x=A\̲b̲.
(1) Mathematically unique solution ,MATLAB The unique solution is also given ;
(2) No solution in Mathematics ,MATLAB Give the least square solution ;
(3) Mathematically, there are infinite solutions ,MATLAB Give the minimum norm solution .
Numerical solutions of nonlinear equations
- Find all the root commands of polynomials roots
roots The call format of is
r=roots§ % Find all roots of a polynomial , here p It's a vector , Is a polynomial from a high power coefficient to a constant
The vector of terms , Return value r Is all roots of a polynomial . - Find the zero point of nonlinear function or the solution of nonlinear equation
fzero function
fsolve function
边栏推荐
- rez:Ephemeral packages
- How to debug the dynamic code generated by C emit?
- Gadget (read Excel data and save it into database table)
- 蔚来缘何没有产品主义?
- 【直播课】腾讯课堂------基于GO语言的云原生工具二次开发实战训练营-------Prometheus Exporter开发
- pytest+request+allure+excel接口自动化搭建 从0到1【三 封装Request请求】
- Taobao development platform store commodity upload interface, store order transaction interface, store order decryption interface, store shelves interface, store order push interface (sorted out compl
- 今天去 OPPO 面试,被问麻了。。。
- . Net webapi to realize interface version control and get through swagger support
- Interface test - process test supports batch parameter import, and the test efficiency is directly full!
猜你喜欢

API interface of all products in JD store (JD whole store product query API interface)

美团一面:@Transactional 原理和常见的坑?

Wechat official account development - Custom Menu

15.1.2 MySQL - MySQL time and timestamp conversion function, UNIX_ timestamp、from_ unixtime

Alibaba cloud - object storage OSS cost optimization

What is sectigo?

使用 docker 搭建 grafana+prometheus 监控数据库资源(贰)

MySQL 读写分离配置实践

Using docker to build grafana+prometheus monitoring database resources (II)

【直播课】腾讯课堂------基于GO语言的云原生工具二次开发实战训练营-------Prometheus Exporter开发
随机推荐
Express keyword search commodity API interface (item_search search search aliexpress commodity interface by keyword)
mysql库使用中卡死或者死锁事件
. Net core uses imagesharp to generate pictures
Basic use and tutorial of Charles
这段sql在pg执行会报错,Oracle没问题
接口测试——流程测试支持批量参数导入,测试效率直接拉满!
【古月21讲】ROS入门系列(2)——发布者Publisher、订阅者Subscriber的编程实现+自定义话题消息编程实现
rez:Ephemeral packages
For 10 consecutive years, the "most commonly used" programming language for programmers ranked first is....
【数学建模暑期培训】Matlab数据预处理
流程测试
Technology companies have opposed the shelving of the UK cybersecurity act
MySQL 读写分离配置实践
【黄啊码】MySQL入门—3、我用select *,老板直接赶我坐火车回家去,买的还是站票
Typescript 14 starting from 0: built in tool type
系统解决方案
Locust performance test 1 (understanding)
Structure and design of kernel
Nvisual secondary development - Chapter 1 Introduction
The security optimization settings after the installation of Zhimeng CMS effectively protect Trojans