Is it wrong with my equation for energy? Cause my manual calculation not same with this.

2 views (last 30 days)
syms t; V=(1/c)*int(exp(t)*sin(3*t)); c=0.003; Energy = (1/2)*c.*V.^2;
Unrecognized function or variable 'c'.
figure(3); fplot(Energy,[0 6]); grid; xlabel('time'); ylabel('Energy'); title('Energy vs time');
  1 Comment
Walter Roberson
Walter Roberson on 31 Aug 2023
syms t c;
V = (1/c)*int(exp(t)*sin(3*t));
Energy = (1/2)*c.*V.^2
Energy = 
C = 0.003;
Energy = subs(Energy, c, C)
Energy = 
figure(3);
fplot(Energy,[0 6]);
grid;
xlabel('time');
ylabel('Energy');
title('Energy vs time');

Sign in to comment.

Answers (1)

Sivapriya Srinivasan
Sivapriya Srinivasan on 31 Aug 2023
Hello,
The equation you provided for calculating energy seems to be correct. However, it's important to note that the integration limits and the value of c might affect the result.
The equation calculates the energy at different time points using the given expression for V and the value of c. It then plots the energy as a function of time.
If you are getting different results from your manual calculation, it's possible that there might be an error in your manual calculation or a discrepancy in the integration limits or value of c you are using.
To confirm if the equation is correct, you can try evaluating V and Energy at specific time points and compare the results with your manual calculations. For example, you can substitute specific values of t into V and Energy and compare them.
To help you further, please provide the details of your manual calculation and the expected result. Additionally, if you have any specific error messages or unexpected outputs, please share them as well. This information will assist in identifying the potential problem and providing a more accurate solution

Categories

Find more on Financial Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!