求解方程可编程的系统?

编程入门 行业动态 更新时间:2024-10-25 18:28:41
本文介绍了求解方程可编程的系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

可能重复:   在C中的线性方程组的++?

我有公式如下2系统:

有关A,B,C,D:

0 = a * r1_x + b * r1_x * r1_y + c * r1_y + d 1 = a * r2_x + b * r2_x * r2_y + c * r2_y + d 0 = a * r3_x + b * r3_x * r3_y + c * r3_y + d 1 = a * r4_x + b * r4_x * r4_y + c * r4_y + d

有关E,F,G,H:

0 = e * r1_x + f * r1_x * r1_y + g * r1_y + h 0 = e * r2_x + f * r2_x * r2_y + g * r2_y + h 1 = e * r3_x + f * r3_x * r3_y + g * r3_y + h 1 = e * r4_x + f * r4_x * r4_y + g * r4_y + h

我知道r1_x,r1_y,r2_x,r2_y,r3_x,r3_y,r4_x,r4_y值, 和需要解决的一个,B,C,在第二D在第一个,并且,E,F,G,H

I know the values of r1_x, r1_y, r2_x, r2_y, r3_x, r3_y, r4_x, r4_y, and need to solve for a,b,c,d in the first one, and ,e,f,g, h in the second.

我知道我会怎样解决这些用铅笔和纸,但我真的不知道该如何编程。我怎么能解决C或C ++(或伪code)。上述方程

I know how I would solve these with pencil and paper, but I'm really unsure how to program it. How could I solve the above equations in C or C++ (or psuedocode).

感谢

推荐答案

您可以将它映射到一个矩阵系统,一λ= B ,其中 A 是系数矩阵, B 是解向量, X 是未知数。既可以实现高斯消去法,或使用公知的文库。如果您使用LAPACK,例行你想让它 dgesv 。

You can map it to a matrix system, A x = b, where A is the coefficient matrix, b is the solution vector, and x are the unknowns. You can either implement Gaussian elimination, or use a well known library. If you use LAPACK, the routine you want it dgesv.

更多推荐

求解方程可编程的系统?

本文发布于:2023-06-04 08:32:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/493301.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可编程   方程   系统

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!