求助VB高手编一个程序,急!
计算一个方程组:当x(i)≥x(j)时,g(i,j)=1400^3/(6*206000*11984224.91)*((x(j)/1400)^2*((3*x(i)-x(j)...
计算一个方程组:
当x(i)≥x(j)时,g(i,j)=1400 ^ 3 / (6 * 206000 * 11984224.91) * ((x(j) / 1400) ^ 2 * ((3 * x(i) - x(j)) / 1400) + (1 + 0.29) * (125 / 1400) ^ 2 * (x(j) / 1400))
当x(i)<x(j)时,g(i,j)=1400 ^ 3 / (6 * 206000 * 11984224.91) * ((x(i) / 1400) ^ 2 * ((3 * x(j) - x(i)) / 1400) + (1 + 0.29) * (125 / 1400) ^ 2 * (x(i) / 1400))
其中:
x(i) = x(i - 1) + 1 / 2 * (50 + 50)
x(j) = x(j - 1) + 1 / 2 * (50 + 50)
i=1~14 j=1~14 x(0)=0
希望最后输出的是一个14*14的矩阵形式,谢谢! 展开
当x(i)≥x(j)时,g(i,j)=1400 ^ 3 / (6 * 206000 * 11984224.91) * ((x(j) / 1400) ^ 2 * ((3 * x(i) - x(j)) / 1400) + (1 + 0.29) * (125 / 1400) ^ 2 * (x(j) / 1400))
当x(i)<x(j)时,g(i,j)=1400 ^ 3 / (6 * 206000 * 11984224.91) * ((x(i) / 1400) ^ 2 * ((3 * x(j) - x(i)) / 1400) + (1 + 0.29) * (125 / 1400) ^ 2 * (x(i) / 1400))
其中:
x(i) = x(i - 1) + 1 / 2 * (50 + 50)
x(j) = x(j - 1) + 1 / 2 * (50 + 50)
i=1~14 j=1~14 x(0)=0
希望最后输出的是一个14*14的矩阵形式,谢谢! 展开
1个回答
展开全部
Dim x(14) As Single, g(14, 14) As Single
x(0) = 0
For i = 1 To 14
x(i) = x(i - 1) + 1 / 2 * (50 + 50)
Print x(i)
Next i
For i = 1 To 14
For j = 1 To 14
If x(i) > x(j) Then
g(i, j) = 1400 ^ 3 / (6 * 206000 * 11984224.91) * ((x(j) / 1400) ^ 2 * ((3 * x(i) - x(j)) / 1400) + (1 + 0.29) * (125 / 1400) ^ 2 * (x(j) / 1400))
Else
g(i, j) = 1400 ^ 3 / (6 * 206000 * 11984224.91) * ((x(i) / 1400) ^ 2 * ((3 * x(j) - x(i)) / 1400) + (1 + 0.29) * (125 / 1400) ^ 2 * (x(i) / 1400))
End If
Next j
Next i
For i = 1 To 14
For j = 1 To 14
Print g(i, j);
Next j
Print
Next i
x(0) = 0
For i = 1 To 14
x(i) = x(i - 1) + 1 / 2 * (50 + 50)
Print x(i)
Next i
For i = 1 To 14
For j = 1 To 14
If x(i) > x(j) Then
g(i, j) = 1400 ^ 3 / (6 * 206000 * 11984224.91) * ((x(j) / 1400) ^ 2 * ((3 * x(i) - x(j)) / 1400) + (1 + 0.29) * (125 / 1400) ^ 2 * (x(j) / 1400))
Else
g(i, j) = 1400 ^ 3 / (6 * 206000 * 11984224.91) * ((x(i) / 1400) ^ 2 * ((3 * x(j) - x(i)) / 1400) + (1 + 0.29) * (125 / 1400) ^ 2 * (x(i) / 1400))
End If
Next j
Next i
For i = 1 To 14
For j = 1 To 14
Print g(i, j);
Next j
Next i
追问
有运行过没?可以么?
为什么我这边出来的不是一个矩阵的形式?数据不对。。
追答
运行过了,由于数值太小,显示不工整
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询