- Verify Mathematical Formulas: Double-check the mathematical formulas against your model or literature to ensure they are implemented correctly. Pay special attention to the units and make sure they are consistent across all calculations.
- Check Initial and Boundary Conditions: Ensure that all initial conditions (Cx0, Ce0, V0, etc.) and boundary conditions (like F, Csf, etc.) are physically plausible and within a realistic range. Incorrect initial conditions could lead to unexpected values that cause domain errors.
- Debugging Step-by-Step: Consider adding breakpoints or disp statements in your function to print out intermediate values of variables like u, Yxs, Yes, and the derivatives. This can help identify exactly where invalid values are first introduced.
- Correct dVdt Calculation: Review and correct the dVdt calculation to accurately reflect the rate of change of volume in the reactor, likely just dVdt = F.
Fed-batch modelling
4 ビュー (過去 30 日間)
古いコメントを表示
I am trying to make fed-batch modelling using simulink. However, this is not working and error: domain error. to compute complex results make at least one input complex e.g. 'power(complex(a)). I could not quite find the problem, as the formula itself seems off (eq. 5, seems like dV/dt does not have its own formula and more like a constant of F). Can you help me how to make the simulation work?
0 件のコメント
回答 (1 件)
prabhat kumar sharma
2024 年 6 月 3 日
Hi Christy,
The error message you've received about computing complex results usually indicates that a mathematical operation within your function is being performed on a value (or set of values) that is not within the valid domain of that operation. Common operations that can lead to this issue include square roots of negative numbers, logarithms of negative numbers, or improper use of exponents that result in complex numbers.
In your function, there are several operations that could potentially lead to domain errors if the inputs are not within a valid range.
I'll recommend you to follow below checks:
You can check this post for better understanding of issue: https://www.mathworks.com/matlabcentral/answers/229261-runtime-error-call-to-matlab-function-aborted-domain-error-to-compute-complex-results-make-at-l
I hope it helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Multicore Processor Targets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!