Skip to content

Instantly share code, notes, and snippets.

@Groostav
Created August 9, 2013 17:18
Show Gist options
  • Save Groostav/347a283ac7ec6a738191 to your computer and use it in GitHub Desktop.
Save Groostav/347a283ac7ec6a738191 to your computer and use it in GitHub Desktop.
Powershell script for PDOL - OPTIP problem
echo "running powershell script! got " $args[0] "as input file and " $args[1] " as output file!"
$data = import-csv $args[0]
$x1 = (0+$data.x1)
$x2 = (0+$data.x2)
#program mimmicks what's in the SC function, except I added an x3 to it,
#and it has no constraints
$output = 4*$x1*$x1 `
- 21/10*[System.math]::pow($x1, 4) `
+ 1/3*[System.math]::pow($x1, 6) `
+ $x1*$x2 `
- 4*[System.math]::pow($x2, 2) `
+ 4*[System.math]::pow($x2, 4) `
"" + "output" + "," + "`n" `
+ $output + "," `
> $args[1]
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment