当前位置:网站首页>第3章-线性方程组(3)
第3章-线性方程组(3)
2022-08-10 10:32:00 【伊伊_f】
from sympy.matrices import *
from sympy import symbols,Eq,solve
1.多阶方程组
a11,a12,a13,a14=symbols('a11 a12 a13 a14')
a21,a22,a23,a24=symbols('a21 a22 a23 a24')
a31,a32,a33,a34=symbols('a31 a32 a33 a34')
a41,a42,a43,a44=symbols('a41 a42 a43 a44')
x1,x2,x3,x4=symbols('x1 x2 x3 x4')
b1,b2,b3,b4=symbols('b1 b2 b3 b4')
f1=Eq(a11*x1+a12*x2+a13*x3+a14*x4,b1)
f2=Eq(a21*x1+a22*x2+a23*x3+a24*x4,b2)
f3=Eq(a31*x1+a32*x2+a33*x3+a34*x4,b3)
f4=Eq(a41*x1+a42*x2+a43*x3+a44*x4,b4)
solve([f1,f2,f3,f4],[x1,x2,x3,x4])
结果:
2.二阶方程组
f1=Eq(a11*x1+a12*x2,b1)
f2=Eq(a21*x1+a22*x2,b2)
solve([f1,f2],[x1,x2])

2. 求方程组解
from sympy.matrices import *
from sympy import symbols,Eq,solve
x1,x2,x3,x4=symbols('x1 x2 x3 x4')
f1=2*x1+x2-5*x3+x4-8
f2=x1-3*x2-6*x4-9
f3=2*x2-x3+2*x4+5
f4=x1+4*x2-7*x3+6*x4
fm=solve([f1,f2,f3,f4],[x1,x2,x3,x4])
fm
![]()
或者
x1,x2,x3,x4=symbols('x1 x2 x3 x4')
f1=Eq(2*x1+x2-5*x3+x4,8)
f2=Eq(x1-3*x2-6*x4,9)
f3=Eq(2*x2-x3+2*x4,-5)
f4=Eq(x1+4*x2-7*x3+6*x4,0)
fm=solve([f1,f2,f3,f4],[x1,x2,x3,x4])
fm
![]()
边栏推荐
- LeetCode Algorithm 1403. 非递增顺序的最小子序列
- 「可扩展性」可扩展性最佳实践:来自eBay的经验教训
- 自动化测试及Selenium
- what is bsp in rtems
- js guessing game source code
- PTA 7-2 方阵对角线元素求和及计数 题解
- 序列化技术ProtoBuf
- Introduction to cross-end development of Taro applet
- runtime-core.esm-bundler.js?d2dd:218 Uncaught TypeError: formRef.value?.validate is not a function
- Summary of whitespace, space and escape characters in C language
猜你喜欢

Swin Transformer作者曹越加入智源,开展视觉基础模型研究

chart.js horizontal column chart plugin

PPT | 「课件」企业中高层人员安全管理培训(118页)

内存问题难定位,那是因为你没用ASAN

MySQL executes the query process
![[Azure Cloud] What is the difference between a service endpoint and a private link?point of view (1)](/img/f6/561a5ff4e518d423cc13a58dcc4383.png)
[Azure Cloud] What is the difference between a service endpoint and a private link?point of view (1)

大连理工&鹏城&UAE提出用于伪装目标检测的混合尺度三重网络ZoomNet,性能SOTA!

交换 生成树 知识总结

14 high-frequency handwritten JS interview questions and answers to consolidate your JS foundation

使用cpolar远程连接群晖NAS(升级固定链接2)
随机推荐
"Time Series Database" uses cassandra to scan time series data
3D rotating text animation js special effects
TCP/IP笔记
chart.js horizontal column chart plugin
大连理工&鹏城&UAE提出用于伪装目标检测的混合尺度三重网络ZoomNet,性能SOTA!
ESP8266 Tutorial 1 - Introduction to ESP8266 Hardware Platform
短视频软件开发——平台同质化如何破局
金九银十跳槽旺季:阿里、百度、京东、美团等技术面试题及答案
LeetCode Algorithm 1472. 设计浏览器历史记录
lua初学
SQL与NoSQL最终会走向融合吗?
Store limited time seckill function system
WebView2 通过 PuppeteerSharp 实现爬取 王者 壁纸 (案例版)
文本选中圆角样式border-radius
Gold, nine, silver and ten job-hopping seasons: technical interview questions and answers on Alibaba, Baidu, JD.com, and Meituan
STM32 encapsulation ESP8266 a key configuration function: implementations of AP mode and the STA mode switch, server and the client to create
Interviewer: Dao, in Service, the Controller, Util, divided into the Model?
Research on motion capture system for indoor combined positioning technology
【C语言】浮点数四舍五入
「数据战略」结果驱动的企业数据策略:组织和治理