{"sections":[{"heading":"Start with a model and a declared purpose","paragraphs":["Use .IV when you want the behaviour of one named junction model in the internally generated helper circuit. It is distinct from .OP/.DC equilibria and from a transient circuit experiment you write yourself. The checked helper uses an area-one junction and its own stepped current source; it does not characterise every component of a larger submitted circuit.","The complete download contains two artificial reference inputs, one realistic-gap diagnostic and the standard-library study client. The reference has IC = 100 µA, RN = 10 Ω, CAP = 0 and RTYPE = 0, with deliberately artificial VG = 100 mV. This keeps the sampled reference away from the unresolved gap-region behaviour. It is a numerical control, not a calibrated process model. Do not change a real junction gap to make it match an equation.","iv_gap_check.cir retains the 2.8 mV gap comparison that remains unresolved under KB-IV-001. Its software run can complete while failing the reference check. The related diagnostic guide records that limit. These two purposes remain separate throughout the instructions."]},{"figures":[{"asset_id":"josim-iv-reference-coarse","caption":"The actual native 20-interval reference run retains 81 voltage/current pairs. This uses the explicitly artificial high-gap model; it is not the held 2.8 mV diagnostic."}],"heading":"Run the reference in JoSIM-Pro","steps":["Extract all four teaching files to a writable folder. Open iv_rsj.cir and keep its complete .MODEL, .OPTION, .IV and .END statements together.","Check the normal licence status and choose Run simulation from the saved netlist tab. The .IV output token requests curve.csv. In the checked default-output setup it is written beside the input; a configured native output directory supplies the containing directory instead.","Read the current task verdict and select the current IV run. Inspect the I(IIV) chart. Its horizontal coordinate is V(BIV), displayed in mV; the vertical quantity is current, displayed in µA. Raw CSV and retained arrays use volts and amperes.","Keep the source and current curve together. For a second run, copy the complete input to a fresh working folder or use a separate native output directory so earlier results remain identifiable."]},{"figures":[{"asset_id":"josim-iv-reference-refined","caption":"The native 40-interval reference run contains 161 points. The helper time step is unchanged; the two curves illustrate a bias-resolution comparison."}],"heading":"Refine the bias grid without changing the question","steps":["Open iv_refined.cir in a separate working generation and run it normally. Its only model-study change is 40 intervals per branch instead of 20.","Confirm 161 finite pairs and preserve their original order. Both positive and negative extrema occur twice; zero occurs once between the positive and negative excursions.","The final current is one negative interval, not zero: -20 µA for 20 intervals and -10 µA for 40. Do not infer a final zero endpoint or sort away the branch sequence.","Compare sampled features on the appropriate branches. A denser bias grid may reveal a missed feature or problem. It does not prove time integration, settling, noise averaging or physical calibration is converged."]},{"heading":"Understand what each point means","paragraphs":["In the exercised implementation, each IV point is produced by an internal transient helper with a 50 fs time step and 1 ns stop time. The reported voltage is the mean of the latter half of the helper voltage samples. The current is the requested bias amplitude. These implementation values are source-qualified for this candidate, not general configurable .IV arguments.","The current-index order is 1…N, N…1, 0…−N and −N…−1, multiplied by Imax/N. That produces 4N+1 rows, including repeated extrema. The native CSV header is V(BIV),I(IIV), in that order. In the GUI retained container, a member historically called TimeArray holds the IV voltage coordinates; its name does not make them seconds.","The run record includes iv_characterization fields for model, maximum current, steps per branch, points and axis units. Its general effective_settings timing can describe the enclosing job rather than the fixed helper (KB-IV-002). Do not use those general fields as proof of a changed IV integration step."]},{"heading":"Check the artificial RSJ reference","paragraphs":["For the constant-resistance, zero-capacitance, noiseless reference, the long-time average is V = sign(I) R sqrt(I² − IC²) above the critical current, and zero on the subcritical branch. The study checks points with |I| ≥ 2 IC using 1% relative difference plus a conservative finite-window allowance 2 Φ0 / 0.5 ns, about 8.27 µV. It also checks small voltage for |I| ≤ 0.8 IC. These are stated teaching checks, not a universal solver-accuracy tolerance.","Both artificial reference grids pass this check; their maximum high-bias relative difference from the analytical relation is approximately 0.382%. A separate 370 µA transient comparison improves for the high-gap control when its authored time step changes from 50 fs to 12.5 fs. The realistic-gap comparison remains outside the same reference check. Matching one simple control does not qualify a physical device."]},{"code":"$ErrorActionPreference = 'Stop'\n$python = 'python'\n$josim = 'C:\\Program Files\\SUN Magnetics\\JoSIM-Pro\\bin\\josim-pro-cli.exe'\n$licence = 'C:\\Program Files\\SUN Magnetics\\Licenses\\sm_license_jpro.txt'\n& $python .\\run_iv.py --josim $josim --licence $licence --results .\\iv-study-001\nif ($LASTEXITCODE -ne 0) { throw 'IV study failed a process, format or numerical check; retain its logs and review before accepting the curve.' }\nGet-Content -LiteralPath .\\iv-study-001\\study.json","heading":"Run both checked grids from Python","paragraphs":["Select your actual Python, compatible JoSIM CLI and existing issued JoSIM licence. From the extracted teaching folder, run the complete command below. The client creates isolated per-study configuration that references the licence path; it does not copy licence contents or change installed settings. It refuses an existing result directory, retains private solver logs and checks current output, order and the declared reference."]},{"heading":"Recognise and recover from a rejected request","steps":["For a missing model, correct the .IV model name or restore the complete .MODEL input. The checked native and CLI rejection preserved an earlier curve; rerunning the valid input into a separate generation recovered.","Use a positive integer step count and a finite nonnegative maximum current. Zero/fractional steps and negative maximum current were rejected in the CLI checks without replacing prior output.","Use an explicit supported CSV destination. Quoted filenames containing spaces were checked. An actual CSV input/output collision was rejected and the source preserved.","If a numerical comparison fails, retain the model, raw curve and logs. Check the resistance law, capacitance, temperature/noise and averaging assumptions. Do not widen the threshold or alter real device parameters solely to obtain a passing label."]},{"code":"* Artificial high-gap RSJ reference control, not a calibrated device\n.MODEL RSJ JJ(RTYPE=0 VG=100m CAP=0 IC=100u RN=10 R0=10)\n.OPTION SEED=321\n.IV RSJ 400u curve.csv 20\n.END","heading":"Save iv_rsj.cir"},{"code":"* Same artificial high-gap control with twice the bias-grid resolution\n.MODEL RSJ JJ(RTYPE=0 VG=100m CAP=0 IC=100u RN=10 R0=10)\n.OPTION SEED=321\n.IV RSJ 400u curve.csv 40\n.END","heading":"Save iv_refined.cir"},{"code":"* Diagnostic only: the constant-resistance reference is held under KB-IV-001\n.MODEL RSJ JJ(RTYPE=0 VG=2.8m CAP=0 IC=100u RN=10 R0=10)\n.OPTION SEED=321\n.IV RSJ 400u gap-curve.csv 40\n.END","heading":"Save iv_gap_check.cir"},{"code":"\"\"\"Run the two supplied IV grids in fresh folders and check their RSJ reference.\"\"\"\nimport argparse\nimport csv\nimport hashlib\nimport json\nimport math\nimport os\nfrom pathlib import Path\nimport shutil\nimport subprocess\nimport sys\n\nPHI0 = 2.067833848e-15\nIC = 100e-6\nRN = 10.0\nMAX_CURRENT = 400e-6\nTAIL_SECONDS = 0.5e-9\n\n\ndef sha(path):return hashlib.sha256(path.read_bytes()).hexdigest()\n\n\ndef schedule(steps):\n    return [i*MAX_CURRENT/steps for i in\n            [*range(1,steps+1), *range(steps,0,-1), *range(0,-steps-1,-1), *range(-steps,0)]]\n\n\ndef read_curve(path, steps):\n    with path.open(encoding='utf-8-sig',newline='') as stream:\n        reader=csv.reader(stream)\n        if next(reader,None)!=['V(BIV)','I(IIV)']:\n            raise ValueError('Expected the native IV voltage/current header, not transient time data.')\n        rows=[[float(x) for x in row] for row in reader if row]\n    expected=schedule(steps)\n    if len(rows)!=4*steps+1 or any(len(row)!=2 or not all(math.isfinite(x) for x in row) for row in rows):\n        raise ValueError('IV sample count or finite two-column shape differs from the teaching contract.')\n    if any(abs(row[1]-i)>1e-15 for row,i in zip(rows,expected)):\n        raise ValueError('IV bias order differs; retain the original branch order and repeated extrema.')\n    return rows\n\n\ndef reference_checks(rows):\n    high=[]\n    sub=[]\n    allowance=2*PHI0/TAIL_SECONDS\n    for voltage,current in rows:\n        if abs(current)>=2*IC-1e-15:\n            expected=math.copysign(RN*math.sqrt(current*current-IC*IC),current)\n            difference=abs(voltage-expected)\n            # A teaching acceptance check: 1% relative plus a conservative\n            # two-phase-period finite-window allowance, not a general error bound.\n            if difference>0.01*abs(expected)+allowance:\n                raise ValueError('High-bias RSJ average differs from this teaching reference check.')\n            high.append((difference,difference/abs(expected)))\n        if abs(current)<=0.8*IC+1e-15:\n            if abs(voltage)>1e-8:\n                raise ValueError('Subcritical teaching voltage is not close to zero.')\n            sub.append(abs(voltage))\n    return {'max_high_bias_abs_difference_V':max(x[0] for x in high),\n            'max_high_bias_relative_difference':max(x[1] for x in high),\n            'max_subcritical_abs_voltage_V':max(sub),\n            'finite_window_allowance_V':allowance}\n\n\ndef main():\n    parser=argparse.ArgumentParser(description=__doc__)\n    parser.add_argument('--josim',type=Path,required=True)\n    parser.add_argument('--licence',type=Path,required=True)\n    parser.add_argument('--results',type=Path,required=True)\n    args=parser.parse_args()\n    root=args.results.resolve()\n    created=False\n    receipt={'schema':'sunmagnetics-iv-study/1','status':'failed','cases':[]}\n    try:\n        if root.exists():raise ValueError('Choose a new results directory; preserve the existing study.')\n        binary=args.josim.resolve();licence=args.licence.resolve()\n        if not binary.is_file() or not licence.is_file():raise ValueError('Select an existing JoSIM executable and issued JoSIM licence.')\n        source=Path(__file__).resolve().parent\n        names=('iv_rsj.cir','iv_refined.cir')\n        for name in names:\n            if not (source/name).is_file():raise ValueError('Restore the complete teaching inputs beside run_iv.py.')\n        root.mkdir(parents=True);created=True\n        home=root/'home/.josimpro';home.mkdir(parents=True)\n        (home/'config.ini').write_text('[General]\\nLicenseLocation='+str(licence)+'\\n',encoding='utf-8')\n        env=os.environ.copy();env['USERPROFILE']=str(home.parent)\n        env['PATH']=str(binary.parent)+os.pathsep+env.get('PATH','')\n        receipt.update(executable_name=binary.name,executable_sha256=sha(binary),inputs={n:sha(source/n) for n in names})\n        curves=[]\n        for steps,name in zip((20,40),names):\n            case=root/('points-'+str(steps));case.mkdir()\n            shutil.copyfile(source/name,case/name)\n            try:\n                run=subprocess.run([str(binary),'-P','17',str(case/name)],cwd=case,env=env,\n                                   stdout=subprocess.PIPE,stderr=subprocess.STDOUT,timeout=90,\n                                   creationflags=getattr(subprocess,'CREATE_NO_WINDOW',0))\n            except subprocess.TimeoutExpired as error:\n                (case/'solver.log').write_bytes(error.stdout or b'')\n                raise ValueError('IV case exceeded 90 seconds; retain its generation and review its log.')\n            (case/'solver.log').write_bytes(run.stdout)\n            row={'steps_per_branch':steps,'exit_code':run.returncode,'status':'failed'}\n            receipt['cases'].append(row)\n            if run.returncode!=0:raise ValueError('JoSIM rejected an IV case; read its solver.log before retrying.')\n            rows=read_curve(case/'curve.csv',steps)\n            row.update(status='passed',rows=len(rows),reference=reference_checks(rows),curve_sha256=sha(case/'curve.csv'))\n            curves.append(rows)\n        receipt.update(status='passed',scope='Artificial VG=100m, overdamped noiseless RSJ control and two bias grids. This avoids the unresolved realistic-gap comparison in iv_gap_check.cir (KB-IV-001). Internal .IV helper time step is unchanged; no device-calibration or general convergence claim.',\n                       axis_columns=['voltage_V','current_A'],source_inputs_preserved=all(sha(source/n)==h for n,h in receipt['inputs'].items()))\n        (root/'study.json').write_text(json.dumps(receipt,indent=2)+'\\n',encoding='utf-8')\n        print(json.dumps({'status':'passed','rows':[len(c) for c in curves],\n                          'max_relative_reference_difference':[r['reference']['max_high_bias_relative_difference'] for r in receipt['cases']]}))\n        return 0\n    except (OSError,ValueError,subprocess.SubprocessError) as error:\n        receipt['reason']=str(error)\n        if created:(root/'study.json').write_text(json.dumps(receipt,indent=2)+'\\n',encoding='utf-8')\n        print(str(error),file=sys.stderr)\n        return 1\n\n\nif __name__=='__main__':raise SystemExit(main())","heading":"Save run_iv.py"},{"heading":"Keep the execution boundary explicit","paragraphs":["Frozen maintained Windows JoSIM 2.9 CLI with normal licence: artificial high-gap constant-resistance reference, complete realistic-gap diagnostic, explicit transient comparisons and real validation/publication failures. No physical device calibration or acceptance of the held gap case. Seven relevant source files match the maintained NAS exactly; one file differs only in a separately reviewed admission-error message, outside IV execution.","Normal licensed Windows JoSIM 2.9 native Run, retained voltage/current arrays, current CSV, typed IV metadata, missing-model rejection/recovery and software completion of the unaccepted gap diagnostic. File opens are supplied at the production boundary; no physical picker/export-dialog or final-package claim.","No physical OS file-picker or plot-export Save dialog is qualified here. The realistic-gap diagnostic is deliberately not accepted as a numerical reference or shown as a validated result image. Final distributed 2.9, other platforms and complete GUI acceptance remain open."]}],"canonical_url":"https://www.sun-magnetics.com/knowledge-base/josim-iv-characterisation","url":"/knowledge-base/josim-iv-characterisation","known_issues":[{"disposition":"hold","id":"KB-IV-001","title":"unresolved gap dependence of an RTYPE=0 RSJ reference","public_notice":"The realistic-gap RTYPE=0 diagnostic remains outside accepted numerical results. The artificial high-gap reference is a teaching control, not a physical workaround for a calibrated junction.","claim_scope":"Only the affected claim and recorded build/input; not whole-guide or final-release acceptance"},{"disposition":"supported_path","id":"KB-IV-002","title":"general IV run-record timing differs from helper controls","public_notice":"Distinguish IV helper timing from the enclosing job settings. The general effective_settings record does not establish the internal IV step or averaging window.","claim_scope":"Only the affected claim and recorded build/input; not whole-guide or final-release acceptance"}],"search_record":{"execution":true,"relatedProducts":[],"version_tags":["JoSIM-Pro 2.9 target"],"text":"Characterise a junction model with an IV curve Run a complete .IV model, read voltage/current coordinates and bias order, then check the model assumptions and numerical reference before accepting its behaviour. JoSIM-Pro 2.9 target; frozen maintained-source Windows candidate Worked example .IV junction characterisation IV curve V(BIV) I(IIV) steps per branch 4N+1 bias grid RSJ iv_rsj.cir iv_refined.cir Start with a model and a declared purpose Use .IV when you want the behaviour of one named junction model in the internally generated helper circuit. It is distinct from .OP/.DC equilibria and from a transient circuit experiment you write yourself. The checked helper uses an area-one junction and its own stepped current source; it does not characterise every component of a larger submitted circuit. The complete download contains two artificial reference inputs, one realistic-gap diagnostic and the standard-library study client. The reference has IC = 100 µA, RN = 10 Ω, CAP = 0 and RTYPE = 0, with deliberately artificial VG = 100 mV. This keeps the sampled reference away from the unresolved gap-region behaviour. It is a numerical control, not a calibrated process model. Do not change a real junction gap to make it match an equation. iv_gap_check.cir retains the 2.8 mV gap comparison that remains unresolved under KB-IV-001. Its software run can complete while failing the reference check. The related diagnostic guide records that limit. These two purposes remain separate throughout the instructions.  Run the reference in JoSIM-Pro Extract all four teaching files to a writable folder. Open iv_rsj.cir and keep its complete .MODEL, .OPTION, .IV and .END statements together. Check the normal licence status and choose Run simulation from the saved netlist tab. The .IV output token requests curve.csv. In the checked default-output setup it is written beside the input; a configured native output directory supplies the containing directory instead. Read the current task verdict and select the current IV run. Inspect the I(IIV) chart. Its horizontal coordinate is V(BIV), displayed in mV; the vertical quantity is current, displayed in µA. Raw CSV and retained arrays use volts and amperes. Keep the source and current curve together. For a second run, copy the complete input to a fresh working folder or use a separate native output directory so earlier results remain identifiable.  The actual native 20-interval reference run retains 81 voltage/current pairs. This uses the explicitly artificial high-gap model; it is not the held 2.8 mV diagnostic. Native JoSIM IV chart for the artificial high-gap RSJ control: voltage V(BIV) in mV against current I(IIV) in µA, with 81 retained points. Refine the bias grid without changing the question Open iv_refined.cir in a separate working generation and run it normally. Its only model-study change is 40 intervals per branch instead of 20. Confirm 161 finite pairs and preserve their original order. Both positive and negative extrema occur twice; zero occurs once between the positive and negative excursions. The final current is one negative interval, not zero: -20 µA for 20 intervals and -10 µA for 40. Do not infer a final zero endpoint or sort away the branch sequence. Compare sampled features on the appropriate branches. A denser bias grid may reveal a missed feature or problem. It does not prove time integration, settling, noise averaging or physical calibration is converged.  The native 40-interval reference run contains 161 points. The helper time step is unchanged; the two curves illustrate a bias-resolution comparison. The same artificial high-gap reference with 40 bias intervals per branch and 161 retained points. This is bias-grid refinement, not a smaller helper time step. Understand what each point means In the exercised implementation, each IV point is produced by an internal transient helper with a 50 fs time step and 1 ns stop time. The reported voltage is the mean of the latter half of the helper voltage samples. The current is the requested bias amplitude. These implementation values are source-qualified for this candidate, not general configurable .IV arguments. The current-index order is 1…N, N…1, 0…−N and −N…−1, multiplied by Imax/N. That produces 4N+1 rows, including repeated extrema. The native CSV header is V(BIV),I(IIV), in that order. In the GUI retained container, a member historically called TimeArray holds the IV voltage coordinates; its name does not make them seconds. The run record includes iv_characterization fields for model, maximum current, steps per branch, points and axis units. Its general effective_settings timing can describe the enclosing job rather than the fixed helper (KB-IV-002). Do not use those general fields as proof of a changed IV integration step.  Check the artificial RSJ reference For the constant-resistance, zero-capacitance, noiseless reference, the long-time average is V = sign(I) R sqrt(I² − IC²) above the critical current, and zero on the subcritical branch. The study checks points with |I| ≥ 2 IC using 1% relative difference plus a conservative finite-window allowance 2 Φ0 / 0.5 ns, about 8.27 µV. It also checks small voltage for |I| ≤ 0.8 IC. These are stated teaching checks, not a universal solver-accuracy tolerance. Both artificial reference grids pass this check; their maximum high-bias relative difference from the analytical relation is approximately 0.382%. A separate 370 µA transient comparison improves for the high-gap control when its authored time step changes from 50 fs to 12.5 fs. The realistic-gap comparison remains outside the same reference check. Matching one simple control does not qualify a physical device.  Run both checked grids from Python Select your actual Python, compatible JoSIM CLI and existing issued JoSIM licence. From the extracted teaching folder, run the complete command below. The client creates isolated per-study configuration that references the licence path; it does not copy licence contents or change installed settings. It refuses an existing result directory, retains private solver logs and checks current output, order and the declared reference. $ErrorActionPreference = 'Stop'\n$python = 'python'\n$josim = 'C:\\Program Files\\SUN Magnetics\\JoSIM-Pro\\bin\\josim-pro-cli.exe'\n$licence = 'C:\\Program Files\\SUN Magnetics\\Licenses\\sm_license_jpro.txt'\n& $python .\\run_iv.py --josim $josim --licence $licence --results .\\iv-study-001\nif ($LASTEXITCODE -ne 0) { throw 'IV study failed a process, format or numerical check; retain its logs and review before accepting the curve.' }\nGet-Content -LiteralPath .\\iv-study-001\\study.json Recognise and recover from a rejected request For a missing model, correct the .IV model name or restore the complete .MODEL input. The checked native and CLI rejection preserved an earlier curve; rerunning the valid input into a separate generation recovered. Use a positive integer step count and a finite nonnegative maximum current. Zero/fractional steps and negative maximum current were rejected in the CLI checks without replacing prior output. Use an explicit supported CSV destination. Quoted filenames containing spaces were checked. An actual CSV input/output collision was rejected and the source preserved. If a numerical comparison fails, retain the model, raw curve and logs. Check the resistance law, capacitance, temperature/noise and averaging assumptions. Do not widen the threshold or alter real device parameters solely to obtain a passing label.  Save iv_rsj.cir * Artificial high-gap RSJ reference control, not a calibrated device\n.MODEL RSJ JJ(RTYPE=0 VG=100m CAP=0 IC=100u RN=10 R0=10)\n.OPTION SEED=321\n.IV RSJ 400u curve.csv 20\n.END Save iv_refined.cir * Same artificial high-gap control with twice the bias-grid resolution\n.MODEL RSJ JJ(RTYPE=0 VG=100m CAP=0 IC=100u RN=10 R0=10)\n.OPTION SEED=321\n.IV RSJ 400u curve.csv 40\n.END Save iv_gap_check.cir * Diagnostic only: the constant-resistance reference is held under KB-IV-001\n.MODEL RSJ JJ(RTYPE=0 VG=2.8m CAP=0 IC=100u RN=10 R0=10)\n.OPTION SEED=321\n.IV RSJ 400u gap-curve.csv 40\n.END Save run_iv.py \"\"\"Run the two supplied IV grids in fresh folders and check their RSJ reference.\"\"\"\nimport argparse\nimport csv\nimport hashlib\nimport json\nimport math\nimport os\nfrom pathlib import Path\nimport shutil\nimport subprocess\nimport sys\n\nPHI0 = 2.067833848e-15\nIC = 100e-6\nRN = 10.0\nMAX_CURRENT = 400e-6\nTAIL_SECONDS = 0.5e-9\n\n\ndef sha(path):return hashlib.sha256(path.read_bytes()).hexdigest()\n\n\ndef schedule(steps):\n    return [i*MAX_CURRENT/steps for i in\n            [*range(1,steps+1), *range(steps,0,-1), *range(0,-steps-1,-1), *range(-steps,0)]]\n\n\ndef read_curve(path, steps):\n    with path.open(encoding='utf-8-sig',newline='') as stream:\n        reader=csv.reader(stream)\n        if next(reader,None)!=['V(BIV)','I(IIV)']:\n            raise ValueError('Expected the native IV voltage/current header, not transient time data.')\n        rows=[[float(x) for x in row] for row in reader if row]\n    expected=schedule(steps)\n    if len(rows)!=4*steps+1 or any(len(row)!=2 or not all(math.isfinite(x) for x in row) for row in rows):\n        raise ValueError('IV sample count or finite two-column shape differs from the teaching contract.')\n    if any(abs(row[1]-i)>1e-15 for row,i in zip(rows,expected)):\n        raise ValueError('IV bias order differs; retain the original branch order and repeated extrema.')\n    return rows\n\n\ndef reference_checks(rows):\n    high=[]\n    sub=[]\n    allowance=2*PHI0/TAIL_SECONDS\n    for voltage,current in rows:\n        if abs(current)>=2*IC-1e-15:\n            expected=math.copysign(RN*math.sqrt(current*current-IC*IC),current)\n            difference=abs(voltage-expected)\n            # A teaching acceptance check: 1% relative plus a conservative\n            # two-phase-period finite-window allowance, not a general error bound.\n            if difference>0.01*abs(expected)+allowance:\n                raise ValueError('High-bias RSJ average differs from this teaching reference check.')\n            high.append((difference,difference/abs(expected)))\n        if abs(current)<=0.8*IC+1e-15:\n            if abs(voltage)>1e-8:\n                raise ValueError('Subcritical teaching voltage is not close to zero.')\n            sub.append(abs(voltage))\n    return {'max_high_bias_abs_difference_V':max(x[0] for x in high),\n            'max_high_bias_relative_difference':max(x[1] for x in high),\n            'max_subcritical_abs_voltage_V':max(sub),\n            'finite_window_allowance_V':allowance}\n\n\ndef main():\n    parser=argparse.ArgumentParser(description=__doc__)\n    parser.add_argument('--josim',type=Path,required=True)\n    parser.add_argument('--licence',type=Path,required=True)\n    parser.add_argument('--results',type=Path,required=True)\n    args=parser.parse_args()\n    root=args.results.resolve()\n    created=False\n    receipt={'schema':'sunmagnetics-iv-study/1','status':'failed','cases':[]}\n    try:\n        if root.exists():raise ValueError('Choose a new results directory; preserve the existing study.')\n        binary=args.josim.resolve();licence=args.licence.resolve()\n        if not binary.is_file() or not licence.is_file():raise ValueError('Select an existing JoSIM executable and issued JoSIM licence.')\n        source=Path(__file__).resolve().parent\n        names=('iv_rsj.cir','iv_refined.cir')\n        for name in names:\n            if not (source/name).is_file():raise ValueError('Restore the complete teaching inputs beside run_iv.py.')\n        root.mkdir(parents=True);created=True\n        home=root/'home/.josimpro';home.mkdir(parents=True)\n        (home/'config.ini').write_text('[General]\\nLicenseLocation='+str(licence)+'\\n',encoding='utf-8')\n        env=os.environ.copy();env['USERPROFILE']=str(home.parent)\n        env['PATH']=str(binary.parent)+os.pathsep+env.get('PATH','')\n        receipt.update(executable_name=binary.name,executable_sha256=sha(binary),inputs={n:sha(source/n) for n in names})\n        curves=[]\n        for steps,name in zip((20,40),names):\n            case=root/('points-'+str(steps));case.mkdir()\n            shutil.copyfile(source/name,case/name)\n            try:\n                run=subprocess.run([str(binary),'-P','17',str(case/name)],cwd=case,env=env,\n                                   stdout=subprocess.PIPE,stderr=subprocess.STDOUT,timeout=90,\n                                   creationflags=getattr(subprocess,'CREATE_NO_WINDOW',0))\n            except subprocess.TimeoutExpired as error:\n                (case/'solver.log').write_bytes(error.stdout or b'')\n                raise ValueError('IV case exceeded 90 seconds; retain its generation and review its log.')\n            (case/'solver.log').write_bytes(run.stdout)\n            row={'steps_per_branch':steps,'exit_code':run.returncode,'status':'failed'}\n            receipt['cases'].append(row)\n            if run.returncode!=0:raise ValueError('JoSIM rejected an IV case; read its solver.log before retrying.')\n            rows=read_curve(case/'curve.csv',steps)\n            row.update(status='passed',rows=len(rows),reference=reference_checks(rows),curve_sha256=sha(case/'curve.csv'))\n            curves.append(rows)\n        receipt.update(status='passed',scope='Artificial VG=100m, overdamped noiseless RSJ control and two bias grids. This avoids the unresolved realistic-gap comparison in iv_gap_check.cir (KB-IV-001). Internal .IV helper time step is unchanged; no device-calibration or general convergence claim.',\n                       axis_columns=['voltage_V','current_A'],source_inputs_preserved=all(sha(source/n)==h for n,h in receipt['inputs'].items()))\n        (root/'study.json').write_text(json.dumps(receipt,indent=2)+'\\n',encoding='utf-8')\n        print(json.dumps({'status':'passed','rows':[len(c) for c in curves],\n                          'max_relative_reference_difference':[r['reference']['max_high_bias_relative_difference'] for r in receipt['cases']]}))\n        return 0\n    except (OSError,ValueError,subprocess.SubprocessError) as error:\n        receipt['reason']=str(error)\n        if created:(root/'study.json').write_text(json.dumps(receipt,indent=2)+'\\n',encoding='utf-8')\n        print(str(error),file=sys.stderr)\n        return 1\n\n\nif __name__=='__main__':raise SystemExit(main()) Keep the execution boundary explicit Frozen maintained Windows JoSIM 2.9 CLI with normal licence: artificial high-gap constant-resistance reference, complete realistic-gap diagnostic, explicit transient comparisons and real validation/publication failures. No physical device calibration or acceptance of the held gap case. Seven relevant source files match the maintained NAS exactly; one file differs only in a separately reviewed admission-error message, outside IV execution. Normal licensed Windows JoSIM 2.9 native Run, retained voltage/current arrays, current CSV, typed IV metadata, missing-model rejection/recovery and software completion of the unaccepted gap diagnostic. File opens are supplied at the production boundary; no physical picker/export-dialog or final-package claim. No physical OS file-picker or plot-export Save dialog is qualified here. The realistic-gap diagnostic is deliberately not accepted as a numerical reference or shown as a validated result image. Final distributed 2.9, other platforms and complete GUI acceptance remain open. ","id":"josim-iv-characterisation","keywords":".IV junction characterisation IV curve V(BIV) I(IIV) steps per branch 4N+1 bias grid RSJ iv_rsj.cir iv_refined.cir","kind":"Worked example","title":"Characterise a junction model with an IV curve","product":"JoSIM-Pro"},"version":"2.9 target; frozen maintained-source Windows candidate","id":"josim-iv-characterisation","related":["/knowledge-base/josim-iv-result-checks","/knowledge-base/josim-junction-resistance"],"downloads":[{"url":"/_functions/kbExample?name=josim-iv-reference.zip","scope":"Exact checked input files plus instructions; final-release/platform applicability remains pending.","files":["iv_rsj.cir","iv_refined.cir","iv_gap_check.cir","run_iv.py","README.txt"],"id":"josim-iv-reference","requires":["Compatible licensed Windows JoSIM 2.9; Studio GUI or CLI, Python 3.13.11 checked for the study","New writable result generations; review the explicit artificial-control and unresolved diagnostic limits"],"title":"Complete IV reference controls and gap diagnostic"}],"publication_status":"published","numerical_output":null,"provenance":{"execution_checks":[{"routes":["python-cli"],"scope":"Frozen maintained Windows JoSIM 2.9 CLI with normal licence: artificial high-gap constant-resistance reference, complete realistic-gap diagnostic, explicit transient comparisons and real validation/publication failures. No physical device calibration or acceptance of the held gap case. Seven relevant source files match the maintained NAS exactly; one file differs only in a separately reviewed admission-error message, outside IV execution.","result":"passed","articles":["josim-iv-characterisation","josim-iv-result-checks"],"purpose":"iv-bias-grid-reference-controls-and-failure-recovery","version":"Frozen maintained-source Windows JoSIM 2.9.0 / CPython 3.13.11","id":"VAL-038","records":["24 independent CLI/artifact/source checks","Complete high-gap reference and realistic-gap diagnostic inputs","Original failed comparisons retained; no tolerance widened to accept the gap case","Eight actual browser-download / exact article-and-README command checks pass in a fresh directory; both artificial controls run and the unresolved diagnostic remains unaccepted"],"limit":"The artificial 100 mV gap control isolates a numerical reference; it is not a physical workaround for the unresolved 2.8 mV gap comparison. No physical calibration or universal convergence claim.","observed":{"row_counts":[81,161],"reference_control_max_relative_differences":[0.0038157044689476846,0.0038157044689476846],"realistic_gap_max_abs_reference_difference_V":0.00030148687658798417,"transient_comparisons":[{"mean_voltage_V":0.0038008109972936664,"relative_reference_difference":0.06695342766053763,"samples":20001,"exit_code":0,"header":["time","V(N)"],"vg":"2.8m","time_step":"50f"},{"mean_voltage_V":0.0037576771339407817,"relative_reference_difference":0.05484500569865343,"samples":80001,"exit_code":0,"header":["time","V(N)"],"vg":"2.8m","time_step":"12.5f"},{"mean_voltage_V":0.0035735605957398137,"relative_reference_difference":0.0031603069166326685,"samples":20001,"exit_code":0,"header":["time","V(N)"],"vg":"100m","time_step":"50f"},{"mean_voltage_V":0.003563246871273341,"relative_reference_difference":0.0002650659590357924,"samples":80001,"exit_code":0,"header":["time","V(N)"],"vg":"100m","time_step":"12.5f"}],"reference_control_max_abs_differences_V":[0.000012341063984182016,0.000012163772016930783]}},{"routes":["gui-native-scenario"],"scope":"Normal licensed Windows JoSIM 2.9 native Run, retained voltage/current arrays, current CSV, typed IV metadata, missing-model rejection/recovery and software completion of the unaccepted gap diagnostic. File opens are supplied at the production boundary; no physical picker/export-dialog or final-package claim.","result":"passed","articles":["josim-iv-characterisation","josim-iv-result-checks"],"purpose":"native-iv-voltage-current-view-and-missing-model-recovery","version":"Frozen maintained-source Windows JoSIM GUI 2.9.0 with matching Clang runtime","id":"VAL-039","records":["16 independent native/artifact checks","Two reviewed native charts of the artificial control","Gap case software completion is separate from numerical acceptance"],"limit":"Current native IV data and typed characterization metadata are checked. General effective_settings timing differs from the fixed helper controls (KB-IV-002). Physical pickers/export-dialogs, other platforms and final packages remain pending.","observed":{"row_counts":[81,161],"axis_name":"Voltage","source_fixed_helper_time_step_s":5e-14,"native_csv_max_serialization_differences":{"coarse":{"current_A":5.421010862427522e-20,"voltage_V":5.204170427930421e-18},"gap":{"current_A":5.421010862427522e-20,"voltage_V":4.7704895589362195e-18},"recovered":{"current_A":5.421010862427522e-20,"voltage_V":5.204170427930421e-18},"refined":{"current_A":5.421010862427522e-20,"voltage_V":5.204170427930421e-18}},"general_record_stop_time_s":1e-10,"source_fixed_helper_stop_time_s":1e-9,"trace_unit":"A","axis_unit":"V","general_record_time_step_s":2.5e-12}}],"figure_evidence":[{"evidence_limit":"Artificial VG=100m reference, not a fabricated-device fit. Physical pickers/export dialogues and final-package visual review remain pending.","id":"josim-iv-reference-coarse","reference_label":"Windows JoSIM 2.9 current-source native scenario, reviewed 4 November 2026"},{"evidence_limit":"Artificial VG=100m reference, not a fabricated-device fit. Physical pickers/export dialogues and final-package visual review remain pending.","id":"josim-iv-reference-refined","reference_label":"Windows JoSIM 2.9 current-source native scenario, reviewed 4 November 2026"}],"review_notes":["The recipe uses an explicitly artificial high-gap control for an analytical check. The complete realistic-gap diagnostic remains available and unaccepted; it is not hidden by changing a tolerance.","The native candidate and relevant numerical path are frozen. Seven selected files match maintained source exactly; one has an unrelated, precisely reviewed admission-error wording difference.","Earlier RTYPE=1 and realistic-gap RTYPE=0 comparisons are retained separately. They do not establish a general solver defect, a calibrated device or an accepted numerical workaround."],"scope":"Recorded inputs/builds only. Complete walkthrough and final-package acceptance remain separate.","verification_requirements":{"gui_method":"product-native-scenario","status":"review-incomplete","illustrations":"required","required":["technical-review","release-applicability","execution","recovery","numerical-interpretation","gui-workflow","illustrations"],"legacy_walkthrough_field":"pending retained; no complete final GUI/package acceptance"},"sources":[{"id":"josim-pro:docs/manual_source/sections/examples.tex","section":"Device and model characterization with .IV; helper-circuit purpose and bias resolution"},{"id":"josim-pro:docs/manual_source/sections/syntax.tex","section":".MODEL junction parameters, .IV and explicit .TRAN syntax; scope and model assumptions remain distinct"},{"id":"josim-pro:docs/manual_source/sections/gui_simulation_results.tex","section":"Current run selection and retained result interpretation"},{"id":"validation:josim-iv-windows-20261104","section":"VAL-038 and VAL-039: complete execution inputs, native voltage/current arrays, analytical controls and explicit KB-IV-001/002 limits"}]},"title":"Characterise a junction model with an IV curve","type":"Worked example","markdown_url":"/_functions/kbResource?path=markdown%2Fjosim-iv-characterisation.md","summary":"Run a complete .IV model, read voltage/current coordinates and bias order, then check the model assumptions and numerical reference before accepting its behaviour.","product":"JoSIM-Pro"}