Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
documentation:language_reference:objects:responsefunction:operations:add [2024/12/17 16:10] Maurits W. Haverkortdocumentation:language_reference:objects:responsefunction:operations:add [2024/12/20 17:16] (current) Maurits W. Haverkort
Line 3: Line 3:
  
 ### ###
-alligned paragraph text+Response functions can be summed using "+"
 ### ###
  
-===== Example =====+==== Example ==== 
 +<code Quanty Example.Quanty> 
 +a1 = {0, -1,-0.5, 0  } 
 +b1 {  0.1, 0.1, 0.1} 
 +G1 ResponseFunction.New( {a1,b1,mu=0,type="ListOfPoles", name="G1"} )
  
-### +a2 = {0, 0.5,  1,  1.5} 
-description text +b2 = {   0.1, 0.1, 0.1} 
-###+G2 = ResponseFunction.New( {a2,b2,mu=0,type="ListOfPoles", name="G2"} )
  
-==== Input ==== +G1 + G2 
-<code Quanty Example.Quanty> + 
--- some example code+print("The response function of G is") 
 +print(G) 
 +omega 1.1 
 +Gamma 0.001 
 +print() 
 +print("Evaluated at omega =",omega," and Gamma =",Gamma," yields\nG (",G(omega,Gamma),"G1 (",G1(omega,Gamma),") + G2(",G2(omega,Gamma),")")
 </code> </code>
 +yields the output
 +<file>
 +The response function of G is
 +{ { 0 , -1 , -0.5 , 0 , 0.5 , 1 , 1.5 } , 
 +  { 0.1 , 0.1 , 0.1 , 0.1 , 0.1 , 0.1 } ,
 +  name = G1 ,
 +  mu = 0 ,
 +  type = ListOfPoles }
  
-==== Result ==== +Evaluated at omega = 1.1 and Gamma = 0.001 yields 
-<file Quanty_Output> +G ( (1.1176700531176 - 0.0055234547287253 I) ) G1 ( (0.20102811094226 - 7.2191421442561e-05 I) ) + G2( (0.91664194217538 - 0.0054512633072828 I) )
-text produced as output+
 </file> </file>
  
Print/export