| /petsc/src/ts/tutorials/power_grid/ |
| H A D | ex3.h | 10 PetscScalar H, D, omega_b, omega_s, Pmax, Pmax_ini, Pm, E, V, X, u_s, c; member 41 if (forwardsolve) user->Pmax = 0.0; /* Apply disturbance - this is done by setting Pmax = 0 */ in PostEventFunction() 42 else user->Pmax = user->Pmax_ini; /* Going backward, reversal of event */ in PostEventFunction() 44 …if (forwardsolve) user->Pmax = user->Pmax_ini; /* Remove the fault - this is done by setting Pmax… in PostEventFunction() 45 else user->Pmax = 0.0; /* Going backward, reversal of event */ in PostEventFunction() 56 PetscScalar *f, Pmax; in RHSFunction() local 63 Pmax = ctx->Pmax; in RHSFunction() 65 …f[1] = ctx->omega_s / (2.0 * ctx->H) * (ctx->Pm - Pmax * PetscSinScalar(u[0]) - ctx->D * (u[1] - c… in RHSFunction() 78 PetscScalar J[2][2], Pmax; in RHSJacobian() local 83 Pmax = ctx->Pmax; in RHSJacobian() [all …]
|
| H A D | ex2.c | 34 PetscScalar H, D, omega_s, Pmax, Pm, E, V, X; member 43 PetscScalar *f, Pmax; in IFunction() local 51 …if ((t > ctx->tf) && (t < ctx->tcl)) Pmax = 0.0; /* A short-circuit on the generator terminal that… in IFunction() 52 else if (t >= ctx->tcl) Pmax = ctx->E / 0.745; in IFunction() 53 else Pmax = ctx->Pmax; in IFunction() 55 f[1] = 2.0 * ctx->H * udot[1] + Pmax * PetscSinScalar(u[0]) + ctx->D * (u[1] - 1.0) - ctx->Pm; in IFunction() 69 PetscScalar J[2][2], Pmax; in IJacobian() local 75 …if ((t > ctx->tf) && (t < ctx->tcl)) Pmax = 0.0; /* A short-circuit on the generator terminal that… in IJacobian() 76 else if (t >= ctx->tcl) Pmax = ctx->E / 0.745; in IJacobian() 77 else Pmax = ctx->Pmax; in IJacobian() [all …]
|
| H A D | ex9.c | 34 PetscScalar H, D, omega_b, omega_s, Pmax, Pm, E, V, X; member 44 PetscScalar *f, Pmax; in RHSFunction() local 50 …if ((t > ctx->tf) && (t < ctx->tcl)) Pmax = 0.0; /* A short-circuit on the generator terminal that… in RHSFunction() 51 else Pmax = ctx->Pmax; in RHSFunction() 54 …f[1] = (-Pmax * PetscSinScalar(u[0]) - ctx->D * (u[1] - ctx->omega_s) + ctx->Pm) * ctx->omega_s / … in RHSFunction() 67 PetscScalar J[2][2], Pmax; in RHSJacobian() local 72 …if ((t > ctx->tf) && (t < ctx->tcl)) Pmax = 0.0; /* A short-circuit on the generator terminal that… in RHSJacobian() 73 else Pmax = ctx->Pmax; in RHSJacobian() 78 J[1][0] = -Pmax * PetscCosScalar(u[0]) * ctx->omega_s / (2.0 * ctx->H); in RHSJacobian() 137 ctx.Pmax = ctx.E * ctx.V / ctx.X; in main() [all …]
|
| H A D | ex9adj.c | 34 PetscScalar H, D, omega_b, omega_s, Pmax, Pm, E, V, X, u_s, c; member 59 PetscScalar *f, Pmax; in RHSFunction() local 66 …if ((t > ctx->tf) && (t < ctx->tcl)) Pmax = 0.0; /* A short-circuit on the generator terminal that… in RHSFunction() 67 else Pmax = ctx->Pmax; in RHSFunction() 70 …f[1] = (-Pmax * PetscSinScalar(u[0]) - ctx->D * (u[1] - ctx->omega_s) + ctx->Pm) * ctx->omega_s / … in RHSFunction() 83 PetscScalar J[2][2], Pmax; in RHSJacobian() local 88 …if ((t > ctx->tf) && (t < ctx->tcl)) Pmax = 0.0; /* A short-circuit on the generator terminal that… in RHSJacobian() 89 else Pmax = ctx->Pmax; in RHSJacobian() 94 J[1][0] = -Pmax * PetscCosScalar(u[0]) * ctx->omega_s / (2.0 * ctx->H); in RHSJacobian() 170 …sensip = 1. / PetscSqrtScalar(1. - (ctx->Pm / ctx->Pmax) * (ctx->Pm / ctx->Pmax)) / ctx->Pmax * x[… in ComputeSensiP() [all …]
|
| H A D | ex9opt.c | 36 PetscScalar H, D, omega_b, omega_s, Pmax, Pm, E, V, X, u_s, c; member 49 PetscScalar *f, Pmax; in RHSFunction() local 56 …if ((t > ctx->tf) && (t < ctx->tcl)) Pmax = 0.0; /* A short-circuit on the generator terminal that… in RHSFunction() 57 else Pmax = ctx->Pmax; in RHSFunction() 60 …f[1] = (-Pmax * PetscSinScalar(u[0]) - ctx->D * (u[1] - ctx->omega_s) + ctx->Pm) * ctx->omega_s / … in RHSFunction() 73 PetscScalar J[2][2], Pmax; in RHSJacobian() local 78 …if ((t > ctx->tf) && (t < ctx->tcl)) Pmax = 0.0; /* A short-circuit on the generator terminal that… in RHSJacobian() 79 else Pmax = ctx->Pmax; in RHSJacobian() 84 J[1][0] = -Pmax * PetscCosScalar(u[0]) * ctx->omega_s / (2.0 * ctx->H); in RHSJacobian() 160 …sensip = 1. / PetscSqrtScalar(1. - (ctx->Pm / ctx->Pmax) * (ctx->Pm / ctx->Pmax)) / ctx->Pmax * x[… in ComputeSensiP() [all …]
|
| H A D | ex3.c | 81 ctx.Pmax = ctx.E * ctx.V / ctx.X; in main() 82 ctx.Pmax_ini = ctx.Pmax; in main() 83 PetscCall(PetscOptionsScalar("-Pmax", "", "", ctx.Pmax, &ctx.Pmax, NULL)); in main() 97 u[0] = PetscAsinScalar(ctx.Pm / ctx.Pmax); in main() 147 u[0] = PetscAsinScalar(ctx.Pm / ctx.Pmax); in main()
|
| H A D | ex3sa.c | 87 ctx.Pmax = ctx.E * ctx.V / ctx.X; in main() 88 ctx.Pmax_ini = ctx.Pmax; in main() 89 PetscCall(PetscOptionsScalar("-Pmax", "", "", ctx.Pmax, &ctx.Pmax, NULL)); in main() 103 u[0] = PetscAsinScalar(ctx.Pm / ctx.Pmax); in main() 159 val[0] = 1. / PetscSqrtScalar(1. - (ctx.Pm / ctx.Pmax) * (ctx.Pm / ctx.Pmax)) / ctx.Pmax; in main() 185 u[0] = PetscAsinScalar(ctx.Pm / ctx.Pmax); in main()
|
| H A D | ex3opt.c | 81 ctx.Pmax = ctx.E * ctx.V / ctx.X; in main() 82 ctx.Pmax_ini = ctx.Pmax; in main() 83 PetscCall(PetscOptionsScalar("-Pmax", "", "", ctx.Pmax, &ctx.Pmax, NULL)); in main() 255 u[0] = PetscAsinScalar(ctx->Pm / ctx->Pmax); in FormFunctionGradient() 284 val[0] = 1. / PetscSqrtScalar(1. - (ctx->Pm / ctx->Pmax) * (ctx->Pm / ctx->Pmax)) / ctx->Pmax; in FormFunctionGradient()
|
| H A D | ex3opt_fd.c | 81 ctx.Pmax = ctx.E * ctx.V / ctx.X; in main() 82 ctx.Pmax_ini = ctx.Pmax; in main() 83 PetscCall(PetscOptionsScalar("-Pmax", "", "", ctx.Pmax, &ctx.Pmax, NULL)); in main() 202 u[0] = PetscAsinScalar(ctx->Pm / ctx->Pmax); in FormFunction()
|
| H A D | ex8.c | 30 PetscScalar Pmax, Pmax_s; /* Maximum power output of generator */ member 130 …if ((t > user->tf) && (t < user->tcl)) user->Pmax = 0.0; /* A short-circuit that drives the electr… in PostStep() 131 else user->Pmax = user->Pmax_s; in PostStep() 160 user->PM_min = user->Pmax * PetscSinScalar(user->mux); in ini_bou() 193 …f = (user->ws / (2 * user->H)) * (user->PM_min - user->Pmax * PetscSinScalar(x) - user->D * (y … in adv2() 304 …c3 = (user->ws / (2.0 * user->H)) * (user->PM_min - user->Pmax * PetscSinScalar(xi) - use… in IJacobian() 346 user->Pmax = user->Pmax_s = 2.1; in Parameter_settings() 350 user->mux = PetscAsinScalar(user->PM_min / user->Pmax); in Parameter_settings() 366 PetscCall(PetscOptionsGetScalar(NULL, NULL, "-Pmax", &user->Pmax, &flg)); in Parameter_settings()
|
| H A D | petscopt_ex6 | 8 -Pmax 2.1
|
| H A D | petscopt_ex7 | 7 -Pmax 2.1
|
| H A D | petscopt_ex8 | 8 -Pmax 2.1
|
| H A D | ex7.c | 24 PetscScalar Pmax; /* Maximum power output of generator */ member 182 user->PM_min = user->Pmax * PetscSinScalar(mux); in ini_bou() 223 f = (user->ws / (2 * user->H)) * (user->PM_min - user->Pmax * PetscSinScalar(x)); in adv2() 328 …c3 = (user->ws / (2.0 * user->H)) * (user->PM_min - user->Pmax * PetscSinScalar(xi)) / us… in IJacobian() 369 user->Pmax = 2.1; in Parameter_settings() 373 user->mux = PetscAsinScalar(user->PM_min / user->Pmax); in Parameter_settings() 393 PetscCall(PetscOptionsGetScalar(NULL, NULL, "-Pmax", &user->Pmax, &flg)); in Parameter_settings()
|
| H A D | ex6.c | 23 PetscScalar Pmax; /* Maximum power output of generator */ member 206 f = (user->ws / (2 * user->H)) * (user->PM_min - user->Pmax * PetscSinScalar(x)); in adv2() 228 fthetac = user->ws / (2 * user->H) * (user->PM_min - user->Pmax * PetscSinScalar(theta)); in BoundaryConditions() 337 fthetac = user->ws / (2 * user->H) * (user->PM_min - user->Pmax * PetscSinScalar(xi)); in IJacobian() 435 …c3 = (user->ws / (2.0 * user->H)) * (user->PM_min - user->Pmax * PetscSinScalar(xi)) / (2 *… in IJacobian() 475 user->Pmax = 2.1; in Parameter_settings() 479 user->mux = PetscAsinScalar(user->PM_min / user->Pmax); in Parameter_settings() 493 PetscCall(PetscOptionsGetScalar(NULL, NULL, "-Pmax", &user->Pmax, &flg)); in Parameter_settings()
|
| /petsc/src/snes/tutorials/network/power/ |
| H A D | case9.m | 30 % bus Pg Qg Qmax Qmin Vg mBase status Pmax Pmin Pc1 Pc2 Qc1min Qc1max Qc2min Qc2max ramp_agc ramp_1…
|