| | |
| | | using MathNet.Numerics.LinearAlgebra.Double; // 引入 Math.NET Numerics 库进行多项式拟合 |
| | | using MathNet.Numerics; |
| | | using MathNet.Numerics; |
| | | using MathNet.Numerics.LinearAlgebra; |
| | | using MathNet.Numerics.LinearAlgebra.Double; // 引入 Math.NET Numerics 库进行多项式拟合 |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Drawing; |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | //using System.Windows.Forms.DataVisualization.Charting; |
| | | using Hydro.CommonBase; |
| | | using Hydro.CommonBase; |
| | | using Newtonsoft.Json; |
| | | using Yw.WinFrmUI.Q3d; |
| | | using Yw.WinFrmUI.Q3d; |
| | | using Yw.WinFrmUI.Q3d; |
| | | |
| | | namespace Hydro.MapView |
| | | namespace Yw.WinFrmUI.Q3d |
| | | { |
| | | [Serializable] |
| | | public class Dataset |
| | |
| | | { |
| | | case "流量扬程曲线": |
| | | return Color.Blue; |
| | | //break; |
| | | //break; |
| | | case "流量功率曲线": |
| | | return Color.Orange; |
| | | //break; |
| | | //break; |
| | | case "流量效率曲线": |
| | | return Color.Red; |
| | | //break; |
| | | //break; |
| | | default: |
| | | return Color.Blue; |
| | | } |
| | |
| | | if (range_X == null) |
| | | { |
| | | range_X = new DRange(double.MaxValue, double.MinValue); |
| | | Data.ForEach(p => { |
| | | Data.ForEach(p => |
| | | { |
| | | if (range_X.Min > p.X) range_X.Min = p.X; |
| | | if (range_X.Max < p.X) range_X.Max = p.X; |
| | | }); |
| | |
| | | double b = coefficients[1]; // 一次项系数 |
| | | double c = coefficients[0] - y; // 常数项系数减去给定的 y 值 |
| | | |
| | | |
| | | |
| | | var roots = MathSolver.Solve(a, b, c); |
| | | if (roots == null)return ErrNum; |
| | | if (roots == null) return ErrNum; |
| | | else return roots.Max(); |
| | | |
| | | } |
| | |
| | | //} |
| | | else |
| | | { |
| | | |
| | | |
| | | return Solve(y); |
| | | } |
| | | } |