Solving a linear Equation with multiple variables serversite for a webapp? Possible with php?

StackOverflow https://stackoverflow.com/questions/4547688

  •  13-10-2019
  •  | 
  •  

문제

I have a gerneral question on php. Hope its ok to ask here.

How would you solve a linear Equation with multiple variables in the web? maybe using Gaussian elimination or ... ? Is it possible with php and recommendable?

1500 + 100 w                 = 10,000 s
3000 + 1000 s                = 3000 w
5000 + 2000 s + 100 w + 30 r = 150 r

=>   s = 0,16 | w = 1,05 | r = 45,21
도움이 되었습니까?

다른 팁

It doesn't really matter whether you're doing it on the web or not, it's the same sort of thing. Gaussian elimination (possibly with some pivoting) is what comes to mind, having been the first unit of my numerical analysis course.

I assume PHP has at least one-dimensional arrays and floating-point numbers, so it should work. Obviously, C or Fortran would give you better performance, if that's an issue.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top