Equation plot problem of dy/dx

7 vues (au cours des 30 derniers jours)
buer le 24 Nov 2015
Hi,
I have one problem does not understand. I have an equation for example: Z=A*dB/dt + B*dA/dt . I know A and B, but how can I plot Z? how I can express dA/dt or dB/dt? I tried with diff(A)./diff(t) this give 1 elements less than A. so it make B*dA/dt not possible. can anyone help.
Thanks a lot.
0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

Réponses (2)

Star Strider le 24 Nov 2015
The gradient function will calculate the first derivative, giving a result the same length as the input vector.
For example:
t = linspace(0, 1);
A = exp(-5*t) .* sin(6*pi*t); % Create Function ‘A’
B = cos(exp(-2*t)*2*pi); % Create Function ‘B’
figure(1)
plot(t, Z)
grid
xlabel('t')
ylabel('Z')
0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

Walter Roberson le 24 Nov 2015
Z=A*dB/dt + B*dA/dt needs to be understood in terms of symbolic A and B,
Z = A(t) * diff(B(t),t) + B(t) * diff(A(t),t)
with A(t) and B(t) functions, this is of course the same as
Z = diff( A(t) .* B(t), t)
As they are functions, you need to substitute the formulas for the functions into Z. Then you evaluate the resulting formula over the set of t values that you want to plot at.
0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

Catégories

En savoir plus sur Calculus dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by