@@ -283,57 +283,57 @@ of differential-algebraic equations (DAEs) which define the evolution of each
283
283
state of the system. The equations are:
284
284
285
285
``` julia
286
- equations (rc_model)
286
+ equations (expand_connections ( rc_model) )
287
287
288
288
20 - element Vector{Equation}:
289
- 0 ~ resistor₊p₊i (t) + source₊p₊i (t)
290
- source₊p₊v (t) ~ resistor₊p₊v (t)
291
- 0 ~ capacitor₊p₊i (t) + resistor₊n₊i (t)
292
- resistor₊n₊v (t) ~ capacitor₊p₊v (t)
293
- 0 ~ capacitor₊n₊i (t) + ground₊g₊i (t) + source₊n₊i (t)
294
- capacitor₊n₊v (t) ~ source₊n₊v (t)
295
- source₊n₊v (t) ~ ground₊g₊v (t)
296
289
resistor₊v (t) ~ resistor₊p₊v (t) - resistor₊n₊v (t)
297
290
0 ~ resistor₊n₊i (t) + resistor₊p₊i (t)
298
291
resistor₊i (t) ~ resistor₊p₊i (t)
299
292
resistor₊v (t) ~ resistor₊R* resistor₊i (t)
300
293
capacitor₊v (t) ~ capacitor₊p₊v (t) - capacitor₊n₊v (t)
301
294
0 ~ capacitor₊n₊i (t) + capacitor₊p₊i (t)
302
295
capacitor₊i (t) ~ capacitor₊p₊i (t)
303
- Differential (t)(capacitor₊v (t)) ~ capacitor₊i (t)* ( capacitor₊C^- 1 )
296
+ Differential (t)(capacitor₊v (t)) ~ capacitor₊i (t) / capacitor₊C
304
297
source₊v (t) ~ source₊p₊v (t) - source₊n₊v (t)
305
298
0 ~ source₊n₊i (t) + source₊p₊i (t)
306
299
source₊i (t) ~ source₊p₊i (t)
307
300
source₊V ~ source₊v (t)
308
301
ground₊g₊v (t) ~ 0
302
+ source₊p₊v (t) ~ resistor₊p₊v (t)
303
+ 0 ~ resistor₊p₊i (t) + source₊p₊i (t)
304
+ resistor₊n₊v (t) ~ capacitor₊p₊v (t)
305
+ 0 ~ capacitor₊p₊i (t) + resistor₊n₊i (t)
306
+ ground₊g₊v (t) ~ source₊n₊v (t)
307
+ ground₊g₊v (t) ~ capacitor₊n₊v (t)
308
+ 0 ~ capacitor₊n₊i (t) + ground₊g₊i (t) + source₊n₊i (t)
309
309
```
310
310
311
311
the states are:
312
312
313
313
``` julia
314
314
states (rc_model)
315
315
316
- 20 - element Vector{Term{Real, Base. ImmutableDict{DataType, Any}}}:
317
- source₊p₊i (t)
318
- resistor₊p₊i (t)
319
- source₊p₊v (t)
320
- resistor₊p₊v (t)
321
- capacitor₊p₊i (t)
322
- resistor₊n₊i (t)
323
- resistor₊n₊v (t)
324
- capacitor₊p₊v (t)
325
- source₊n₊i (t)
326
- capacitor₊n₊i (t)
327
- ground₊g₊i (t)
328
- capacitor₊n₊v (t)
329
- source₊n₊v (t)
330
- ground₊g₊v (t)
316
+ 20 - element Vector{Any}:
331
317
resistor₊v (t)
332
318
resistor₊i (t)
319
+ resistor₊p₊v (t)
320
+ resistor₊p₊i (t)
321
+ resistor₊n₊v (t)
322
+ resistor₊n₊i (t)
333
323
capacitor₊v (t)
334
324
capacitor₊i (t)
325
+ capacitor₊p₊v (t)
326
+ capacitor₊p₊i (t)
327
+ capacitor₊n₊v (t)
328
+ capacitor₊n₊i (t)
335
329
source₊v (t)
336
330
source₊i (t)
331
+ source₊p₊v (t)
332
+ source₊p₊i (t)
333
+ source₊n₊v (t)
334
+ source₊n₊i (t)
335
+ ground₊g₊v (t)
336
+ ground₊g₊i (t)
337
337
```
338
338
339
339
and the parameters are:
@@ -361,17 +361,15 @@ representation of the system. Let's see what it does here:
361
361
sys = structural_simplify (rc_model)
362
362
equations (sys)
363
363
364
- 2 - element Vector{Equation}:
365
- 0 ~ capacitor₊v (t) + resistor₊R* resistor₊i (t) - source₊V
366
- Differential (t)(capacitor₊v (t)) ~ resistor₊i (t)* (capacitor₊C^- 1 )
364
+ 1 - element Vector{Equation}:
365
+ Differential (t)(capacitor₊v (t)) ~ capacitor₊i (t) / capacitor₊C
367
366
```
368
367
369
368
``` julia
370
369
states (sys)
371
370
372
- 2 - element Vector{Any}:
371
+ 1 - element Vector{Term{Real, Base . ImmutableDict{DataType, Any}} }:
373
372
capacitor₊v (t)
374
- capacitor₊p₊i (t)
375
373
```
376
374
377
375
After structural simplification we are left with a system of only two equations
@@ -419,25 +417,26 @@ variables. Let's see what our observed variables are:
419
417
``` julia
420
418
observed (sys)
421
419
422
- 18 - element Vector{Equation}:
423
- capacitor₊i (t) ~ resistor₊i (t)
424
- ground₊g₊i (t) ~ 0.0
425
- source₊n₊i (t) ~ resistor₊i (t)
426
- source₊i (t) ~ - resistor₊i (t)
427
- source₊p₊i (t) ~ - resistor₊i (t)
428
- capacitor₊n₊i (t) ~ - resistor₊i (t)
420
+ 19 - element Vector{Equation}:
421
+ ground₊g₊i (t) ~ 0
429
422
resistor₊n₊v (t) ~ capacitor₊v (t)
430
- resistor₊n₊i (t) ~ - resistor₊i (t)
431
- resistor₊p₊i (t) ~ resistor₊i (t)
432
- capacitor₊p₊i (t) ~ resistor₊i (t)
433
423
capacitor₊p₊v (t) ~ capacitor₊v (t)
434
- capacitor₊n₊v (t) ~ 0.0
435
- source₊n₊v (t) ~ 0.0
436
- ground₊g₊v (t) ~ 0.0
424
+ capacitor₊n₊v (t) ~ 0
425
+ source₊n₊v (t) ~ 0
426
+ ground₊g₊v (t) ~ 0
437
427
source₊v (t) ~ source₊V
438
- source₊p₊v (t) ~ source₊v (t)
439
428
resistor₊p₊v (t) ~ source₊v (t)
429
+ source₊p₊v (t) ~ source₊v (t)
440
430
resistor₊v (t) ~ source₊v (t) - capacitor₊v (t)
431
+ capacitor₊i (t) ~ resistor₊v (t) / resistor₊R
432
+ resistor₊i (t) ~ capacitor₊i (t)
433
+ source₊i (t) ~ - capacitor₊i (t)
434
+ resistor₊n₊i (t) ~ - capacitor₊i (t)
435
+ resistor₊p₊i (t) ~ capacitor₊i (t)
436
+ source₊p₊i (t) ~ - capacitor₊i (t)
437
+ source₊n₊i (t) ~ capacitor₊i (t)
438
+ capacitor₊p₊i (t) ~ capacitor₊i (t)
439
+ capacitor₊n₊i (t) ~ - capacitor₊i (t)
441
440
```
442
441
443
442
These are explicit algebraic equations which can then be used to reconstruct
0 commit comments