Changeset f1c754b4 in OpenModelica
- Timestamp:
- 2014-10-14T16:19:12+02:00 (10 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 997af4ed
- Parents:
- c030536
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Compiler/BackEnd/ExpressionSolve.mo
rfbc604a rf1c754b4 282 282 then 283 283 (res,asserts); 284 // f(a)^ n = c => f(a) = c^(1/n)284 // f(a)^x = c => f(a) = {+,-}*c^(1/x) 285 285 // where n is odd 286 case (DAE.BINARY(e1,DAE.POW( _),e2 as DAE.RCONST(r)), _, DAE.CREF(componentRef = cr))286 case (DAE.BINARY(e1,DAE.POW(tp),e2), _, DAE.CREF(componentRef = cr)) 287 287 equation 288 1.0 = realMod(r,2.0);289 288 false = Expression.expHasCref(inExp2, cr); 290 289 true = Expression.expHasCref(e1, cr); 290 false = Expression.expHasCref(e2, cr); 291 291 res = Expression.expDiv(DAE.RCONST(1.0),e2); 292 292 res = Expression.expPow(inExp2,res); 293 293 (res, asserts) = solve(e1,res,inExp3); 294 e11 = Expression.makePureBuiltinCall("pre",{inExp3},tp); 295 e11 = DAE.IFEXP(DAE.RELATION(e11,DAE.GREATEREQ(tp),DAE.RCONST(0.0),-1,NONE()),DAE.RCONST(1.0),DAE.RCONST(-1.0)); 296 res = Expression.expMul(e11,res); 294 297 then 295 298 (res,asserts);
Note: See TracChangeset
for help on using the changeset viewer.