Skip to content

Latest commit

 

History

History
182 lines (123 loc) · 3.71 KB

File metadata and controls

182 lines (123 loc) · 3.71 KB

Getting Started

This guide shows the shortest path from a fresh checkout to running CUFSM Octave CLI.

Requirements

  • GNU Octave with octave-cli available on the command line.
  • Python 3.9 or newer, if using the Python helper package.
  • Git, if cloning from GitHub.
  • A terminal: PowerShell, Command Prompt, Windows Terminal, macOS Terminal, Linux shell, or WSL.

Check Octave with:

octave-cli --version

Install GNU Octave

Windows Installer

Download GNU Octave from:

https://octave.org/download

After installation, open a new PowerShell or Command Prompt window and run:

octave-cli --version

If the command is not found, restart the terminal or add the Octave installation directory to PATH.

Windows PowerShell With winget

winget install -e --id GNU.Octave

Then open a new terminal and check:

octave-cli --version

Windows Subsystem For Linux

For Ubuntu or Debian in WSL:

sudo apt update
sudo apt install octave git

macOS

Using Homebrew:

brew update
brew install octave

Ubuntu / Debian Linux

sudo apt update
sudo apt install octave git

Get The Repository

git clone https://github.com/someparsa/cufsm-octave.git
cd cufsm-octave

Run The JSON Example

The JSON workflow is the preferred workflow for repeatable analysis:

octave-cli --quiet cufsm_json.m examples/lipped-channel.json

It writes:

examples/lipped-channel-results.json
examples/lipped-channel-results.txt

The JSON result is the machine-readable result. The text report is easier to inspect manually.

Install The Python Helpers

From the repository root:

python -m pip install -e .

Optional extras are installed separately:

python -m pip install -e ".[validation]"
python -m pip install -e ".[plotting]"
python -m pip install -e ".[dataframe]"

The validation extra enables full JSON Schema validation with jsonschema. The plotting extra enables matplotlib signature-curve plotting. The dataframe extra enables pandas result-table helpers.

Run the checked-in JSON example through Python:

from cufsm_octave import run_cufsm

result = run_cufsm("examples/lipped-channel.json")
print(result.overall_minimum)

Generate a JSON input from a named section template:

from cufsm_octave import write_section_input

write_section_input(
    "examples/generated-unlipped-channel.json",
    "unlipped-channel",
    depth=8.0,
    flange=3.0,
    thickness=0.075,
    fy=50.0,
    output_path="examples/generated-unlipped-channel-results.json",
)

Plot an existing result JSON after installing the plotting extra:

python examples/postprocess_signature_curve.py \
  examples/lipped-channel-results.json \
  examples/lipped-channel-signature-curve.png

Run the Python batch and optimization examples:

python examples/python_batch_lipped_channel.py
python examples/python_optimize_lipped_channel.py

These examples generate their own input/result files under examples/batch-results/ and examples/optimization-results/.

Run The Legacy Script Example

The older hardcoded example is still available:

octave-cli --quiet cufsm-octave-example.m

It writes:

cufsm-results.txt

Use this mostly as a reference for the original hardcoded Octave workflow. Prefer the JSON runner for new work.

Running From WSL Against A Windows Folder

If the repository is stored on a Windows drive and you run Octave through WSL, use a command like:

wsl bash -lc "cd /mnt/c/path/to/cufsm-octave && octave-cli --quiet cufsm_json.m examples/lipped-channel.json"

Replace /mnt/c/path/to/cufsm-octave with the actual WSL path.