Jspice3
cosderiv.c
Go to the documentation of this file.
1 /**********
2 Copyright 1990 Regents of the University of California. All rights reserved.
3 Author: 1989 Jaijeet S. Roychowdhury
4 **********/
5 
6 #include "spice.h"
7 #include <math.h>
8 
9 #define JOB char
10 #include "distodef.h"
11 
12 /*
13  * CosDeriv computes the partial derivatives of the cosine
14  * function where the argument to the function is itself a
15  * function of three variables p, q, and r.
16  */
17 
18 void
19 CosDeriv(new, old)
20 Dderivs *new, *old;
21 {
22 
23 Dderivs temp;
24 
25 EqualDeriv(&temp, old);
26 
27 new->value = cos (temp.value);
28 new->d1_p = - sin(temp.value)*temp.d1_p;
29 new->d1_q = - sin(temp.value)*temp.d1_q;
30 new->d1_r = - sin(temp.value)*temp.d1_r;
31 new->d2_p2 = -(cos(temp.value)*temp.d1_p*temp.d1_p + sin(temp.value)*temp.d2_p2);
32 new->d2_q2 = -(cos(temp.value)*temp.d1_q*temp.d1_q + sin(temp.value)*temp.d2_q2);
33 new->d2_r2 = -(cos(temp.value)*temp.d1_r*temp.d1_r + sin(temp.value)*temp.d2_r2);
34 new->d2_pq = -(cos(temp.value)*temp.d1_p*temp.d1_q + sin(temp.value)*temp.d2_pq);
35 new->d2_qr = -(cos(temp.value)*temp.d1_q*temp.d1_r + sin(temp.value)*temp.d2_qr);
36 new->d2_pr = -(cos(temp.value)*temp.d1_p*temp.d1_r + sin(temp.value)*temp.d2_pr);
37 new->d3_p3 = -(sin(temp.value)*(temp.d3_p3 - temp.d1_p*temp.d1_p*temp.d1_p)
38  + cos(temp.value)*(temp.d1_p*temp.d2_p2 + temp.d1_p*temp.d2_p2
39  + temp.d1_p*temp.d2_p2));
40 new->d3_q3 = -(sin(temp.value)*(temp.d3_q3 - temp.d1_q*temp.d1_q*temp.d1_q)
41  + cos(temp.value)*(temp.d1_q*temp.d2_q2 + temp.d1_q*temp.d2_q2
42  + temp.d1_q*temp.d2_q2));
43 new->d3_r3 = -(sin(temp.value)*(temp.d3_r3 - temp.d1_r*temp.d1_r*temp.d1_r)
44  + cos(temp.value)*(temp.d1_r*temp.d2_r2 + temp.d1_r*temp.d2_r2
45  + temp.d1_r*temp.d2_r2));
46 new->d3_p2r = -(sin(temp.value)*(temp.d3_p2r - temp.d1_r*temp.d1_p*temp.d1_p)
47  + cos(temp.value)*(temp.d1_p*temp.d2_pr + temp.d1_p*temp.d2_pr
48  + temp.d1_r*temp.d2_p2));
49 new->d3_p2q = -(sin(temp.value)*(temp.d3_p2q - temp.d1_q*temp.d1_p*temp.d1_p)
50  + cos(temp.value)*(temp.d1_p*temp.d2_pq + temp.d1_p*temp.d2_pq
51  + temp.d1_q*temp.d2_p2));
52 new->d3_q2r = -(sin(temp.value)*(temp.d3_q2r - temp.d1_r*temp.d1_q*temp.d1_q)
53  + cos(temp.value)*(temp.d1_q*temp.d2_qr + temp.d1_q*temp.d2_qr
54  + temp.d1_r*temp.d2_q2));
55 new->d3_pq2 = -(sin(temp.value)*(temp.d3_pq2 - temp.d1_p*temp.d1_q*temp.d1_q)
56  + cos(temp.value)*(temp.d1_q*temp.d2_pq + temp.d1_q*temp.d2_pq
57  + temp.d1_p*temp.d2_q2));
58 new->d3_pr2 = -(sin(temp.value)*(temp.d3_pr2 - temp.d1_p*temp.d1_r*temp.d1_r)
59  + cos(temp.value)*(temp.d1_r*temp.d2_pr + temp.d1_r*temp.d2_pr
60  + temp.d1_p*temp.d2_r2));
61 new->d3_qr2 = -(sin(temp.value)*(temp.d3_qr2 - temp.d1_q*temp.d1_r*temp.d1_r)
62  + cos(temp.value)*(temp.d1_r*temp.d2_qr + temp.d1_r*temp.d2_qr
63  + temp.d1_q*temp.d2_r2));
64 new->d3_pqr = -(sin(temp.value)*(temp.d3_pqr - temp.d1_r*temp.d1_p*temp.d1_q)
65  + cos(temp.value)*(temp.d1_q*temp.d2_pr + temp.d1_p*temp.d2_qr
66  + temp.d1_r*temp.d2_pq));
67  }
double d2_pr
Definition: distodef.h:75
double d3_pr2
Definition: distodef.h:83
double d3_pq2
Definition: distodef.h:81
double d3_p3
Definition: distodef.h:76
double d1_q
Definition: distodef.h:68
double d2_pq
Definition: distodef.h:73
double d3_pqr
Definition: distodef.h:85
double d2_r2
Definition: distodef.h:72
double d3_p2r
Definition: distodef.h:80
double d2_qr
Definition: distodef.h:74
double d1_r
Definition: distodef.h:69
double d1_p
Definition: distodef.h:67
double d3_qr2
Definition: distodef.h:84
double cos()
double d3_q3
Definition: distodef.h:77
double sin()
double d3_q2r
Definition: distodef.h:82
double value
Definition: distodef.h:66
double d3_r3
Definition: distodef.h:78
double d3_p2q
Definition: distodef.h:79
double d2_q2
Definition: distodef.h:71
double d2_p2
Definition: distodef.h:70
void CosDeriv(Dderivs *new, Dderivs *old)
Definition: cosderiv.c:19
void EqualDeriv(Dderivs *new, Dderivs *old)
Definition: equalder.c:17