Home > Software engineering >  O vb6.0 by use application solutions for the two equations.
O vb6.0 by use application solutions for the two equations.

Time:09-16






If this can't make up can try simplified version, mainly requirement is not simplified version,




Bosses analyse, to make it!

CodePudding user response:

Have a high school knowledge is solved, the matlab to do better,

CodePudding user response:

Don't listen to the upstairs talk nonsense, my son have learned 3 grade 6 yuan a system of equations, it doesn't need high school knowledge!!!!!
Has not let the MATLAB to Harbin Institute of Technology, there are some things I want to be able to solve

Your equation into standard format
A0x1 + a1x2 + a2x3 + a3=0
B0x1 + b1x2 + b2x3 + b3=0
C0x1 + c1x2 + c2x3 + c3=0

Output with the input coefficient matrix, matrix
Such as your the simplified adiabatic
A (0, 0)=2.045: a (0, 1)=1: a (0, 2)=0: a (0, 3)=100.9
A (1, 0)=1: a (1, 1)=2.045: a (1, 2)=1: a (1, 3)=0.9
A (2, 0)=0: a (2, 1)=1: a (2, 2)=1.0225: a (2, 3)=0.45

After the input output
(1)=58.94995 x
(2)=19.65265 x
(3)=19.66029 x

 
The Public Function JFC (aryInput () As Single, aryOutput () As Single) As Boolean
Dim n As an Integer, m As an Integer, As an Integer k, w As Single, myArry () As Single
Dim I As an Integer, j As Integer
N=UBound (aryInput, 1)
M=UBound (aryInput, 2)
K=UBound (aryOutput)
If n & lt; & gt; K/n + 1 & lt; & gt; M Then
MsgBox "aryInput don't match, or a unique array of rows does not match with the result,", vbExclamation
JFC=False
The Exit Function
End the If
ReDim myArry (n, m)
For I=0 To n
For j=0 To m
MyArry (I, j)=aryInput (I, j)
Next j
Next I

For I=0 To n
For j=I + 1 To n
If Abs (myArry (I, I)) & lt; Abs (myArry (j, I)) Then
For k=I To the n + 1
W=myArry (I, k)
MyArry (I, k)=myArry (j, k)
MyArry (j, k)=w
Next k
End the If
Next j
If myArry (I, I)=0 Then
MsgBox "has at least one group of homogeneous equation, this equation the wuding aryOutput,", vbExclamation
JFC=False
The Exit Function
End the If
For j=I + 1 To m
MyArry (I, j)=myArry (I, j)/myArry (I, I)
Next j
MyArry (I, I)=1
For j=I + 1 To n
W=myArry (j, I)
For k=I To m
MyArry (j, k)=myArry (j, k) - myArry (I, k) * w
Next k
Next j
Next I
For I=n To 0 Step - 1
W=0
For j=I + 1 To n
W=w + myArry (I, j) * aryOutput (j)
Next j
AryOutput (I)=(myArry (I, m) - w)/myArry (I, I)
Next I
JFC=True
End the Function

Private Sub Command1_Click ()
Dim n As an Integer, () As a Single, x () As Single
N=3 '3 unknowns
ReDim a (n - 1, n)
ReDim x (n - 1)

A (0, 0)=2.045: a (0, 1)=1: a (0, 2)=0: a (0, 3)=100.9
A (1, 0)=1: a (1, 1)=2.045: a (1, 2)=1: a (1, 3)=0.9
A (2, 0)=0: a (2, 1)=1: a (2, 2)=1.0225: a (2, 3)=0.45


If JFC ((a), x ()) Then
For k=0 To n - 1
Print (" x "; K + 1; "); "="; X (k)
Next k
End the If
End Sub


Private Sub Form_Load ()
Me. AutoRedraw=True
End Sub

CodePudding user response:

 
The import numpy as np
A=np. Mat ([2.045, 1, 0,
1, 2.045, 1,
0,1,1.0225]). Reshape (3, 3)
B=np. Mat ([100.9, 0.9, 0.45]). Reshape ((3, 1))
Print (a, b, np. Dot (Anderson, b), sep="\ n")

# Out:
[[2.045 to 1. 0.]
/1-2.045-1.
[0. 1. 1.0225]]
[[100.9]
[0.9]
[0.45]]
[[58.94994887]
[19.65264544]
[19.66028894]]

CodePudding user response:

Knowledge is power, learning,

CodePudding user response:

The
reference 3 floor zhyj_88 response:
 
The import numpy as np
A=np. Mat ([2.045, 1, 0,
1, 2.045, 1,
0,1,1.0225]). Reshape (3, 3)
B=np. Mat ([100.9, 0.9, 0.45]). Reshape ((3, 1))
Print (a, b, np. Dot (Anderson, b), sep="\ n")

# Out:
[[2.045 to 1. 0.]
/1-2.045-1.
[0. 1. 1.0225]]
[[100.9]
[0.9]
[0.45]]
[[58.94994887]
[19.65264544]
[19.66028894]]


VB potential single, Python came to play pavilion
  • Related